1
1
/*
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.
3
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
4
*
5
5
* This code is free software; you can redistribute it and/or modify it
26
26
27
27
void * AdlAllocateHeap (size_t size) {
28
28
unsigned char * ptr = (unsigned char *) malloc (size);
29
- if (ptr == NULL && size != 0 ) {
29
+ if (ptr == nullptr && size != 0 ) {
30
30
fprintf (stderr, " Error: Out of memory in ADLC\n " ); // logging can cause crash!
31
31
fflush (stderr);
32
32
exit (1 );
@@ -36,7 +36,7 @@ void* AdlAllocateHeap(size_t size) {
36
36
37
37
void * AdlReAllocateHeap (void * old_ptr, size_t size) {
38
38
unsigned char * ptr = (unsigned char *) realloc (old_ptr, size);
39
- if (ptr == NULL && size != 0 ) {
39
+ if (ptr == nullptr && size != 0 ) {
40
40
fprintf (stderr, " Error: Out of memory in ADLC\n " ); // logging can cause crash!
41
41
fflush (stderr);
42
42
exit (1 );
@@ -53,7 +53,7 @@ void AdlChunk::operator delete(void* p, size_t length) {
53
53
}
54
54
55
55
AdlChunk::AdlChunk (size_t length) {
56
- _next = NULL ; // Chain on the linked list
56
+ _next = nullptr ; // Chain on the linked list
57
57
_len = length; // Save actual size
58
58
}
59
59
@@ -71,7 +71,7 @@ void AdlChunk::chop() {
71
71
72
72
void AdlChunk::next_chop () {
73
73
_next->chop ();
74
- _next = NULL ;
74
+ _next = nullptr ;
75
75
}
76
76
77
77
// ------------------------------AdlArena------------------------------------------
@@ -164,8 +164,8 @@ void *AdlArena::Arealloc( void *old_ptr, size_t old_size, size_t new_size ) {
164
164
// Reset this AdlArena to empty, and return this AdlArenas guts in a new AdlArena.
165
165
AdlArena *AdlArena::reset (void ) {
166
166
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 ;
169
169
return a; // Return AdlArena with guts
170
170
}
171
171
0 commit comments