Skip to content

Commit

Permalink
8299974: Replace NULL with nullptr in share/adlc/
Browse files Browse the repository at this point in the history
Reviewed-by: dlong, kvn
  • Loading branch information
jdksjolen committed May 26, 2023
1 parent f09345b commit 62537d2
Show file tree
Hide file tree
Showing 19 changed files with 1,270 additions and 1,266 deletions.
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;
return a; // Return AdlArena with guts
}

Expand Down

1 comment on commit 62537d2

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

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

Please sign in to comment.