RFR: 8276887: G1: Move precleaning to Concurrent Mark From Roots subphase [v4]

Albert Mingkun Yang ayang at openjdk.java.net
Sun Nov 14 23:08:13 UTC 2021


On Sun, 14 Nov 2021 06:28:55 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   review
>
> src/hotspot/share/gc/shared/referenceProcessor.cpp line 1075:
> 
>> 1073:   constexpr int ref_kinds = 4;
>> 1074:   ReferenceType ref_type_arr[] = { REF_SOFT, REF_WEAK, REF_FINAL, REF_PHANTOM };
>> 1075:   static_assert(ARRAY_SIZE(ref_type_arr) == ref_kinds, "invariant");
> 
> I don't think there's a need for the literal 4 initializer for ref_kinds and the static assert to verify it's correct.  Why not just use this after the declaration of `ref_type_arr`?
> `constexpr int ref_kinds = ARRAY_SIZE(ref_type_arr);`

Changed as suggested.

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

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


More information about the hotspot-gc-dev mailing list