RFR: 8253286: Use expand_exact() instead of expand_at() for fixed requests in G1
Stefan Johansson
sjohanss at openjdk.java.net
Mon Sep 21 07:24:17 UTC 2020
On Sat, 19 Sep 2020 09:17:04 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
> Sth like expand_exact(curr, (uint)-1, NULL). (Ofc, this is a contrived example.)
True, with bad input `expand_exact()` will likely assert or crash. But as you've noticed, we make sure that the input
is within bounds and valid. I agree that using a for-loop here is better, and I can file an enhancement for this. I
would like this change to only address how we expand the found regions.
> Maybe this is obvious to veterans, but making it explicit is more friendly for newcomers, IMO.
I agree that making the code easier to understand is great, and to me using `expand_exact()` which can only expand this
exact region should make it easier to follow. Even though the name doesn't say so `expand_at()` will expand any region
starting at the given index, which to me is both wrong and very confusing for cases where you've found a specific
region you want to make available.
-------------
PR: https://git.openjdk.java.net/jdk/pull/235
More information about the hotspot-gc-dev
mailing list