RFR: 8344665: Refactor PartialArrayState allocation for reuse [v2]
Thomas Schatzl
tschatzl at openjdk.org
Thu Nov 28 16:26:48 UTC 2024
On Thu, 28 Nov 2024 15:31:05 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:
>> src/hotspot/share/gc/shared/partialArrayState.hpp line 185:
>>
>>> 183: // - low half: allocators constructed
>>> 184: // - high half: allocators destructed (debug only)
>>> 185: volatile CounterState _counters;
>>
>> Seems like a lot of code overhead to accomodate debugging! However, if there is no easier approach, then not a blocker for me.
>
> I feel the motivation for this encoding is missing from this PR. It's not immediately clear why these two counters need to be combined in this way. Kim outlined some rationale during our offline discussion, but for the benefit of other reviewers and future readers of this code, this rationale should be documented alongside the encoding. Having those arguments written down would help assess whether the additional complexity is justified.
What about using a union/struct instead of all that manual masking and shifting?
I agree that encoding them in this way should give a rationale for that.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/22287#discussion_r1862458445
More information about the hotspot-gc-dev
mailing list