RFR: 8273626: G1: Factor out concurrent segmented array from G1CardSetAllocator [v3]

Hamlin Li mli at openjdk.java.net
Sat Oct 9 03:07:11 UTC 2021


On Fri, 8 Oct 2021 09:26:45 GMT, Thomas Schatzl <tschatzl at openjdk.org> wrote:

>> Hamlin Li has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains five additional commits since the last revision:
>> 
>>  - Merge branch 'openjdk:master' into generalize-g1CardSetBuffer-and-Allocator
>>  - Rename Xxx to G1Xxx
>>  - Clean code
>>  - Fix wrong length() in SegmentedArrayBuffer, cause it might grow more than _elem_nums
>>  - Initial commit
>
> src/hotspot/share/gc/g1/g1CardSetMemory.hpp line 99:
> 
>> 97: // memory.
>> 98: template <class Elem>
>> 99: class G1CardSetAllocator : public G1SegmentedArray<Elem, mtGCCardSet> {
> 
> I think a `G1CardSetAllocator` *has* or *uses* a `G1SegmentedArray`, but itself is not. I.e. this does not seem to be a proper is-a relation, so the subclassing here seems wrong.
> Adding a member of that type and using it seems better to me.

Agree!

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

PR: https://git.openjdk.java.net/jdk/pull/5478



More information about the hotspot-gc-dev mailing list