8301178: Replace NULL with nullptr in share/gc/epsilon/

Reviewed-by: tschatzl, kbarrett
This commit is contained in:
Johan Sjölen 2023-01-27 09:35:42 +00:00
parent f7da09c349
commit b77abc6a0d
3 changed files with 12 additions and 10 deletions

@ -1,4 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2018, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -39,8 +40,8 @@ EpsilonBarrierSet::EpsilonBarrierSet() : BarrierSet(
make_barrier_set_assembler<BarrierSetAssembler>(),
make_barrier_set_c1<BarrierSetC1>(),
make_barrier_set_c2<BarrierSetC2>(),
NULL /* barrier_set_nmethod */,
NULL /* barrier_set_stack_chunk */,
nullptr /* barrier_set_nmethod */,
nullptr /* barrier_set_stack_chunk */,
BarrierSet::FakeRtti(BarrierSet::EpsilonBarrierSet)) {}
void EpsilonBarrierSet::on_thread_create(Thread *thread) {

@ -1,4 +1,5 @@
/*
* Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved.
* Copyright (c) 2017, 2022, Red Hat, Inc. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
@ -104,11 +105,11 @@ EpsilonHeap* EpsilonHeap::heap() {
HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
assert(is_object_aligned(size), "Allocation size should be aligned: " SIZE_FORMAT, size);
HeapWord* res = NULL;
HeapWord* res = nullptr;
while (true) {
// Try to allocate, assume space is available
res = _space->par_allocate(size);
if (res != NULL) {
if (res != nullptr) {
break;
}
@ -118,7 +119,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
// Try to allocate under the lock, assume another thread was able to expand
res = _space->par_allocate(size);
if (res != NULL) {
if (res != nullptr) {
break;
}
@ -137,7 +138,7 @@ HeapWord* EpsilonHeap::allocate_work(size_t size, bool verbose) {
assert(expand, "Should be able to expand");
} else {
// No space left:
return NULL;
return nullptr;
}
_space->set_end((HeapWord *) _virtual_space.high());
@ -235,7 +236,7 @@ HeapWord* EpsilonHeap::allocate_new_tlab(size_t min_size,
// All prepared, let's do it!
HeapWord* res = allocate_work(size);
if (res != NULL) {
if (res != nullptr) {
// Allocation successful
*actual_size = size;
if (EpsilonElasticTLABDecay) {
@ -297,7 +298,7 @@ void EpsilonHeap::print_on(outputStream *st) const {
_virtual_space.print_on(st);
if (_space != NULL) {
if (_space != nullptr) {
st->print_cr("Allocation space:");
_space->print_on(st);
}

@ -55,7 +55,7 @@ public:
EpsilonHeap() :
_memory_manager("Epsilon Heap", ""),
_space(NULL) {};
_space(nullptr) {};
Name kind() const override {
return CollectedHeap::Epsilon;
@ -114,7 +114,7 @@ public:
void unpin_object(JavaThread* thread, oop obj) override { }
// No support for block parsing.
HeapWord* block_start(const void* addr) const { return NULL; }
HeapWord* block_start(const void* addr) const { return nullptr; }
bool block_is_obj(const HeapWord* addr) const { return false; }
// No GC threads