Skip to content

Commit 2f3ab0e

Browse files
committed
Implement review comment
1 parent 38f9629 commit 2f3ab0e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/hotspot/share/gc/g1/g1CollectedHeap.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -419,6 +419,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, bool allow_
419419
result = _allocator->attempt_allocation_using_new_region(word_size);
420420
if (result != NULL) {
421421
return result;
422+
} else if (!allow_gc) {
423+
return nullptr;
422424
}
423425

424426
// If the GCLocker is active and we are bound for a GC, try expanding young gen.
@@ -452,8 +454,6 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, bool allow_
452454
log_trace(gc, alloc)("%s: Successfully scheduled collection returning " PTR_FORMAT,
453455
Thread::current()->name(), p2i(result));
454456
return result;
455-
} else if (!allow_gc) {
456-
return nullptr;
457457
}
458458

459459
if (succeeded) {

0 commit comments

Comments
 (0)