RFR: 8358483: G1: Remove G1HeapRegionManager::num_available_regions
Sangheon Kim
sangheki at openjdk.org
Fri Jun 6 16:58:51 UTC 2025
On Thu, 5 Jun 2025 08:50:38 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> Simple cleanup of moving an API from `G1HeapRegionManager` to `G1CollectedHeap`.
>>
>> Test: tier1
>
>> Perhaps we disagree on whether `num_available_regions()` should be considered a basic API.
>
> Thank you for the term; I was having a difficult time finding an accurate word for it. Since its implementation involves calculations based on other counters, I tend to view it as a "compound" API -- better suited at the level of the owner of `G1HeapRegionManager` rather than being part of its core interface. Hence, the suggestion in this PR.
>
> (There are other "compound" APIs, e.g. `uint num_used_regions() const { return num_committed_regions() - num_free_regions(); }`, which I think also belongs to `G1CollectedHeap`.)
I like the term 'compound' API, but still I cannot fully agree with you, @albertnetymk. e.g. if there is other user of `G1HeapRegionManager`, the new one also needs to implement such compound API again.
I do not want to block you if others agree with this change.
-------------
PR Comment: https://git.openjdk.org/jdk/pull/25611#issuecomment-2949872087
More information about the hotspot-gc-dev
mailing list