1
1
/*
2
+ * Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
2
3
* Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
3
4
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
5
*
@@ -104,11 +105,11 @@ EpsilonHeap* EpsilonHeap::heap() {
104
105
HeapWord* EpsilonHeap::allocate_work (size_t size, bool verbose) {
105
106
assert (is_object_aligned (size), " Allocation size should be aligned: " SIZE_FORMAT, size);
106
107
107
- HeapWord* res = NULL ;
108
+ HeapWord* res = nullptr ;
108
109
while (true ) {
109
110
// Try to allocate, assume space is available
110
111
res = _space->par_allocate (size);
111
- if (res != NULL ) {
112
+ if (res != nullptr ) {
112
113
break ;
113
114
}
114
115
@@ -118,7 +119,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
118
119
119
120
// Try to allocate under the lock, assume another thread was able to expand
120
121
res = _space->par_allocate (size);
121
- if (res != NULL ) {
122
+ if (res != nullptr ) {
122
123
break ;
123
124
}
124
125
@@ -137,7 +138,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
137
138
assert (expand, " Should be able to expand" );
138
139
} else {
139
140
// No space left:
140
- return NULL ;
141
+ return nullptr ;
141
142
}
142
143
143
144
_space->set_end ((HeapWord *) _virtual_space.high ());
@@ -235,7 +236,7 @@ HeapWord* EpsilonHeap::allocate_new_tlab(size_t min_size,
235
236
// All prepared, let's do it!
236
237
HeapWord* res = allocate_work (size);
237
238
238
- if (res != NULL ) {
239
+ if (res != nullptr ) {
239
240
// Allocation successful
240
241
*actual_size = size;
241
242
if (EpsilonElasticTLABDecay) {
@@ -297,7 +298,7 @@ void EpsilonHeap::print_on(outputStream *st) const {
297
298
298
299
_virtual_space.print_on (st);
299
300
300
- if (_space != NULL ) {
301
+ if (_space != nullptr ) {
301
302
st->print_cr (" Allocation space:" );
302
303
_space->print_on (st);
303
304
}
0 commit comments