Skip to content

Commit 62537d2

Browse files
committed
8299974: Replace NULL with nullptr in share/adlc/
Reviewed-by: dlong, kvn
1 parent f09345b commit 62537d2

19 files changed

+1270
-1266
lines changed

src/hotspot/share/adlc/adlArena.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 1998, 2022, Oracle and/or its affiliates. All rights reserved.
2+
* Copyright (c) 1998, 2023, Oracle and/or its affiliates. All rights reserved.
33
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
44
*
55
* This code is free software; you can redistribute it and/or modify it
@@ -26,7 +26,7 @@
2626

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

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

5555
AdlChunk::AdlChunk(size_t length) {
56-
_next = NULL; // Chain on the linked list
56+
_next = nullptr; // Chain on the linked list
5757
_len = length; // Save actual size
5858
}
5959

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

7272
void AdlChunk::next_chop() {
7373
_next->chop();
74-
_next = NULL;
74+
_next = nullptr;
7575
}
7676

7777
//------------------------------AdlArena------------------------------------------
@@ -164,8 +164,8 @@ void *AdlArena::Arealloc( void *old_ptr, size_t old_size, size_t new_size ) {
164164
// Reset this AdlArena to empty, and return this AdlArenas guts in a new AdlArena.
165165
AdlArena *AdlArena::reset(void) {
166166
AdlArena *a = new AdlArena(this); // New empty arena
167-
_first = _chunk = NULL; // Normal, new-arena initialization
168-
_hwm = _max = NULL;
167+
_first = _chunk = nullptr; // Normal, new-arena initialization
168+
_hwm = _max = nullptr;
169169
return a; // Return AdlArena with guts
170170
}
171171

0 commit comments

Comments
 (0)