Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

8299974: Replace NULL with nullptr in share/adlc/ #14008

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 7 additions & 7 deletions src/hotspot/share/adlc/adlArena.cpp
@@ -1,5 +1,5 @@
/*
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
Expand All @@ -26,7 +26,7 @@

void* AdlAllocateHeap(size_t size) {
unsigned char* ptr = (unsigned char*) malloc(size);
if (ptr == NULL && size != 0) {
if (ptr == nullptr && size != 0) {
fprintf(stderr, "Error: Out of memory in ADLC\n"); // logging can cause crash!
fflush(stderr);
exit(1);
Expand All @@ -36,7 +36,7 @@ void* AdlAllocateHeap(size_t size) {

void* AdlReAllocateHeap(void* old_ptr, size_t size) {
unsigned char* ptr = (unsigned char*) realloc(old_ptr, size);
if (ptr == NULL && size != 0) {
if (ptr == nullptr && size != 0) {
fprintf(stderr, "Error: Out of memory in ADLC\n"); // logging can cause crash!
fflush(stderr);
exit(1);
Expand All @@ -53,7 +53,7 @@ void AdlChunk::operator delete(void* p, size_t length) {
}

AdlChunk::AdlChunk(size_t length) {
_next = NULL; // Chain on the linked list
_next = nullptr; // Chain on the linked list
_len = length; // Save actual size
}

Expand All @@ -71,7 +71,7 @@ void AdlChunk::chop() {

void AdlChunk::next_chop() {
_next->chop();
_next = NULL;
_next = nullptr;
}

//------------------------------AdlArena------------------------------------------
Expand Down Expand Up @@ -164,8 +164,8 @@ void *AdlArena::Arealloc( void *old_ptr, size_t old_size, size_t new_size ) {
// Reset this AdlArena to empty, and return this AdlArenas guts in a new AdlArena.
AdlArena *AdlArena::reset(void) {
AdlArena *a = new AdlArena(this); // New empty arena
_first = _chunk = NULL; // Normal, new-arena initialization
_hwm = _max = NULL;
_first = _chunk = nullptr; // Normal, new-arena initialization
_hwm = _max = nullptr;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Align

return a; // Return AdlArena with guts
}

Expand Down