Skip to content

Commit 734e2e1

Browse files
committed
even better position to bail out
1 parent 2f3ab0e commit 734e2e1

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
@@ -410,6 +410,8 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, bool allow_
410410
result = _allocator->attempt_allocation(word_size, word_size, &actual_size);
411411
if (result != NULL) {
412412
return result;
413+
} else if (!allow_gc) {
414+
return nullptr;
413415
}
414416

415417
preventive_collection_required = policy()->preventive_collection_required(1);
@@ -419,8 +421,6 @@ HeapWord* G1CollectedHeap::attempt_allocation_slow(size_t word_size, bool allow_
419421
result = _allocator->attempt_allocation_using_new_region(word_size);
420422
if (result != NULL) {
421423
return result;
422-
} else if (!allow_gc) {
423-
return nullptr;
424424
}
425425

426426
// If the GCLocker is active and we are bound for a GC, try expanding young gen.

0 commit comments

Comments
 (0)