RFR: 8273626: G1: Factor out concurrent segmented array from G1CardSetAllocator [v4]
Thomas Schatzl
tschatzl at openjdk.java.net
Thu Oct 14 11:31:00 UTC 2021
On Thu, 14 Oct 2021 09:03:14 GMT, Hamlin Li <mli at openjdk.org> wrote:
>> src/hotspot/share/gc/g1/g1SegmentedArray.hpp line 150:
>>
>>> 148: }
>>> 149:
>>> 150: uint next_num_elems(uint prev_num_elems) {
>>
>> Probably it's best to define this as virtual abstract and override as needed in subclasses. Or just keep the implementation from `G1CardSetAllocOptions` here for now.
>
> I'm afraid I have missed something more important, _alloc_options in G1SegmentedArray should be a pointer rather than value, as its behaviour should be polymorphic, so I also made more changes to address this issue in g1CardSetMemory.cpp, g1CardSet.cpp/hpp. At the same time, I also do a little improvement on the allocation of G1CardSetAllocOptions in G1CardSetConfiguration, it was allocated every time mem_object_alloc_options is invoked, now it's only allocated once in G1CardSetConfiguration, hope I'm doing the right thing here.
Please keep not absolutely necessary changes to separate CRs (or *at least* separate commits in the same CR). These are very quickly reviewed if small. However, adding these to large refactorings is definitely the wrong thing to do, making reviewers spend extraordinary amount of time to separate them from the refactoring.
-------------
PR: https://git.openjdk.java.net/jdk/pull/5478
More information about the hotspot-gc-dev
mailing list