Skip to content

Commit

Permalink
8301178: Replace NULL with nullptr in share/gc/epsilon/
Browse files Browse the repository at this point in the history
Reviewed-by: tschatzl, kbarrett
  • Loading branch information
jdksjolen committed Jan 27, 2023
1 parent f7da09c commit b77abc6
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
5 changes: 3 additions & 2 deletions src/hotspot/share/gc/epsilon/epsilonBarrierSet.cpp
@@ -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.
*
Expand Down Expand Up @@ -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) {
Expand Down
13 changes: 7 additions & 6 deletions src/hotspot/share/gc/epsilon/epsilonHeap.cpp
@@ -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.
*
Expand Down Expand Up @@ -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;
}

Expand All @@ -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;
}

Expand All @@ -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());
Expand Down Expand Up @@ -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) {
Expand Down Expand Up @@ -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);
}
Expand Down
4 changes: 2 additions & 2 deletions src/hotspot/share/gc/epsilon/epsilonHeap.hpp
Expand Up @@ -55,7 +55,7 @@ class EpsilonHeap : public CollectedHeap {

EpsilonHeap() :
_memory_manager("Epsilon Heap", ""),
_space(NULL) {};
_space(nullptr) {};

Name kind() const override {
return CollectedHeap::Epsilon;
Expand Down Expand Up @@ -114,7 +114,7 @@ class EpsilonHeap : public CollectedHeap {
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
Expand Down

1 comment on commit b77abc6

@openjdk-notifier
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.