RFR: 8332517: G1: Refactor G1AllocRegion [v3]

Thomas Schatzl tschatzl at openjdk.org
Tue Jul 2 12:24:20 UTC 2024


On Tue, 2 Jul 2024 10:23:47 GMT, Ivan Walulya <iwalulya at openjdk.org> wrote:

>> Hi all,
>> 
>> Please review this refactoring change to move `_used_bytes_before` out of the base class and into the only child class G1GCAllocRegion that requires those details.
>> 
>> Additionally, I removed wrapper methods that do not seem to improve readability in anyway.
>> 
>> Testing: Tier 1-3
>
> Ivan Walulya has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Albert review

Changes requested by tschatzl (Reviewer).

src/hotspot/share/gc/g1/g1AllocRegion.hpp line 243:

> 241:   // This can be used to set the active region to a specific
> 242:   // region. (Use Example: we try to retain the last old GC alloc
> 243:   // region that we've used during a GC and we can use set() to

I think this should be `reuse` instead of `set` here.
Also `set` could be protected now. The comment here and for `set` are duplicated, I think it is good enough to keep at `reuse`.

src/hotspot/share/gc/g1/g1HeapRegion.inline.hpp line 188:

> 186: inline HeapWord* G1HeapRegion::par_allocate(size_t min_word_size,
> 187:                                           size_t desired_word_size,
> 188:                                           size_t* actual_word_size) {

pre-existing: indentation

src/hotspot/share/gc/g1/g1HeapRegion.inline.hpp line 217:

> 215: inline HeapWord* G1HeapRegion::allocate(size_t min_word_size,
> 216:                                       size_t desired_word_size,
> 217:                                       size_t* actual_word_size) {

pre-existing: indentation

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

PR Review: https://git.openjdk.org/jdk/pull/19902#pullrequestreview-2152973331
PR Review Comment: https://git.openjdk.org/jdk/pull/19902#discussion_r1662406594
PR Review Comment: https://git.openjdk.org/jdk/pull/19902#discussion_r1662007902
PR Review Comment: https://git.openjdk.org/jdk/pull/19902#discussion_r1662007619


More information about the hotspot-gc-dev mailing list