RFR: 8237913: G1CollectedHeap::heap_region_containing shouldn't be a template.

Kim Barrett kbarrett at openjdk.org
Thu Jul 21 06:40:11 UTC 2022


On Wed, 20 Jul 2022 15:00:52 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

> Hi all,
> 
>   can I have reviews for this change that removes the templates and casts around `G1CollectedHeap::heap_region_containing`?
> 
> Testing: tier1-5
> 
> Thanks,
>   Thomas

src/hotspot/share/gc/g1/g1CollectedHeap.hpp line 1129:

> 1127:   // Returns the HeapRegion that contains addr, or nullptr if that is an uncommitted
> 1128:   // region. addr must not be nullptr.
> 1129:   inline HeapRegion* heap_region_containing_or_null(HeapWord* addr) const;

Why does `heap_region_containing` take `void*` but `heap_region_containing_or_null` takes `HeapWord*`.  Seems like they should be the same (probably `void*` for both?).  And why did the `const` qualifier get dropped for the or_null variant?

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

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



More information about the hotspot-gc-dev mailing list