RFR: 8337981: ShenandoahHeap::is_in should check for alive regions [v2]

Roman Kennke rkennke at openjdk.org
Wed Aug 14 16:42:52 UTC 2024


On Wed, 14 Aug 2024 16:34:58 GMT, Aleksey Shipilev <shade at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahHeap.cpp line 759:
>> 
>>> 757:     // objects during Full GC across the regions in not yet determinate state.
>>> 758:     return is_full_gc_move_in_progress() ||
>>> 759:            heap_region_containing(p)->is_active();
>> 
>> Should this also check against the region bounds?
>
> Not sure I understand. The if-condition checks that we are pointing into heap. This means `heap_region_containing` always returns the region.

heap_region_containing() returns the region for which bottom <= p < end, my question is if we should check if bottom <= p < top, in other words if p is within the region's currently allocated part (as opposed to the unallocated tail, if any).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20492#discussion_r1717248921


More information about the shenandoah-dev mailing list