RFR: 8237913: G1CollectedHeap::heap_region_containing shouldn't be a template [v2]

Thomas Schatzl tschatzl at openjdk.org
Wed Jul 27 19:25:39 UTC 2022


On Tue, 26 Jul 2022 21:37:26 GMT, Sangheon Kim <sangheki at openjdk.org> wrote:

>> Thomas Schatzl has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   kbarrett review
>
> src/hotspot/share/gc/g1/g1CollectedHeap.inline.hpp line 108:
> 
>> 106: }
>> 107: 
>> 108: inline HeapRegion* G1CollectedHeap::heap_region_containing_or_null(HeapWord* addr) const {
> 
> Why 2 asserts are removed?
> Because the only caller has already checked such things?

The `addr_to_region` call in this method already checks whether the given address is in the heap and `nullptr` is always outside the heap, so redundant anyway.

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

PR: https://git.openjdk.org/jdk/pull/9572



More information about the hotspot-gc-dev mailing list