RFC: Draft JEP: Generational ZGC

Stefan Karlsson stefan.karlsson at oracle.com
Tue Oct 18 07:04:11 UTC 2022



On 2022-10-17 23:29, Florian Weimer wrote:
> * Stefan Karlsson:
>
>> Hi Leslie,
>>
>> Could you test if this branch compiles as expected?
>> https://urldefense.com/v3/__https://github.com/stefank/jdk/tree/zgc_generational_found_old_initialization__;!!ACWV5N9M2RV99hQ!OUIXbhb-2J7tyT8IheLMCpFLO8CER_p02IZP9jLkjXmacT-du-7PX4GoG35UcCv8J9ger-rwQZdhQ_bDue8$
>>
>> I asked around and it seems like array initialization uses
>> copy-initialization of the elements, and that older GCCs didn't take the
>> opportunity to convert the copying into move operations. Or something
>> along those lines. I've restructured the code to prevent that problem.
> GCC 10 needs this patch as well.
>
> I think the proper fix is to add a move constructor to CHeapBitMap
> (and move assignment as well):
>
>    CHeapBitMap(CHeapBitMap &&) = default;
>    CHeapBitMap &operator=(CHeapBitMap &&) = default;
>
> I don't see any pointers-to-self in the class definition (or its base
> class), so it should work, but I only have limited means to test this.
>
> At least it's building with the two lines added, and basic smoke
> testing shows nothing amiss.  But I don't know how quickly bugs in
> this area would blow up in practice.

Thanks for the suggestion! I'm going to push my current patch for now, 
since it is limited in areas of the JVM that it potentially affects. I 
still think it's worth considering if we should make the bitmaps 
moveable, and I'd like us to handle that as a separate RFE.

Thanks,
StefanK


More information about the zgc-dev mailing list