Skip to content

Commit b77abc6

Browse files
committedJan 27, 2023
8301178: Replace NULL with nullptr in share/gc/epsilon/
Reviewed-by: tschatzl, kbarrett
1 parent f7da09c commit b77abc6

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed
 

‎src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp

+3-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
23
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
@@ -39,8 +40,8 @@ EpsilonBarrierSet::EpsilonBarrierSet() : BarrierSet(
3940
make_barrier_set_assembler<BarrierSetAssembler>(),
4041
make_barrier_set_c1<BarrierSetC1>(),
4142
make_barrier_set_c2<BarrierSetC2>(),
42-
NULL /* barrier_set_nmethod */,
43-
NULL /* barrier_set_stack_chunk */,
43+
nullptr /* barrier_set_nmethod */,
44+
nullptr /* barrier_set_stack_chunk */,
4445
BarrierSet::FakeRtti(BarrierSet::EpsilonBarrierSet)) {}
4546

4647
void EpsilonBarrierSet::on_thread_create(Thread *thread) {

‎src/hotspot/share/gc/epsilon/epsilonHeap.cpp

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/*
2+
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
23
* Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
34
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
45
*
@@ -104,11 +105,11 @@ EpsilonHeap* EpsilonHeap::heap() {
104105
HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
105106
assert(is_object_aligned(size), "Allocation size should be aligned: " SIZE_FORMAT, size);
106107

107-
HeapWord* res = NULL;
108+
HeapWord* res = nullptr;
108109
while (true) {
109110
// Try to allocate, assume space is available
110111
res = _space->par_allocate(size);
111-
if (res != NULL) {
112+
if (res != nullptr) {
112113
break;
113114
}
114115

@@ -118,7 +119,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
118119

119120
// Try to allocate under the lock, assume another thread was able to expand
120121
res = _space->par_allocate(size);
121-
if (res != NULL) {
122+
if (res != nullptr) {
122123
break;
123124
}
124125

@@ -137,7 +138,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
137138
assert(expand, "Should be able to expand");
138139
} else {
139140
// No space left:
140-
return NULL;
141+
return nullptr;
141142
}
142143

143144
_space->set_end((HeapWord *) _virtual_space.high());
@@ -235,7 +236,7 @@ HeapWord* EpsilonHeap::allocate_new_tlab(size_t min_size,
235236
// All prepared, let's do it!
236237
HeapWord* res = allocate_work(size);
237238

238-
if (res != NULL) {
239+
if (res != nullptr) {
239240
// Allocation successful
240241
*actual_size = size;
241242
if (EpsilonElasticTLABDecay) {
@@ -297,7 +298,7 @@ void EpsilonHeap::print_on(outputStream *st) const {
297298

298299
_virtual_space.print_on(st);
299300

300-
if (_space != NULL) {
301+
if (_space != nullptr) {
301302
st->print_cr("Allocation space:");
302303
_space->print_on(st);
303304
}

‎src/hotspot/share/gc/epsilon/epsilonHeap.hpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ class EpsilonHeap : public CollectedHeap {
5555

5656
EpsilonHeap() :
5757
_memory_manager("Epsilon Heap", ""),
58-
_space(NULL) {};
58+
_space(nullptr) {};
5959

6060
Name kind() const override {
6161
return CollectedHeap::Epsilon;
@@ -114,7 +114,7 @@ class EpsilonHeap : public CollectedHeap {
114114
void unpin_object(JavaThread* thread, oop obj) override { }
115115

116116
// No support for block parsing.
117-
HeapWord* block_start(const void* addr) const { return NULL; }
117+
HeapWord* block_start(const void* addr) const { return nullptr; }
118118
bool block_is_obj(const HeapWord* addr) const { return false; }
119119

120120
// No GC threads

0 commit comments

Comments
 (0)
Please sign in to comment.