Integrated: 8291457: Clean up lifecycle of CDS dump-time data structures

Ioi Lam iklam at openjdk.org
Thu Aug 4 18:21:40 UTC 2022


On Wed, 3 Aug 2022 07:15:49 GMT, Ioi Lam <iklam at openjdk.org> wrote:

> I've rewritten the following data CDS structures to follow the [C++ rule-of-three](https://en.cppreference.com/w/cpp/language/rule_of_three) to improve their lifecycle handling and fix a memory leak. This is done to prepare for future CDS changes that make more allocations during archive creation.
> 
>> Rule of Three: If a class requires a user-defined destructor, a user-defined copy constructor, or a user-defined copy assignment operator, it almost certainly requires all three.
> 
> - DumpTimeClassInfo
> - DumpTimeClassInfo::DTLoaderConstraint
> - DumpTimeClassInfo::DTVerifierConstraint
> - DumpTimeLambdaProxyClassInfo
> 
> I implemented some of the assignment operators using the [copy-and-swap idiom](https://en.cppreference.com/w/cpp/language/copy_assignment) to handle `Symbol` refcounting. Thanks to @kimbarrett for the suggestion.

This pull request has now been integrated.

Changeset: fd9ac621
Author:    Ioi Lam <iklam at openjdk.org>
URL:       https://git.openjdk.org/jdk/commit/fd9ac6216111063968675ced5d032310447d5206
Stats:     212 lines in 7 files changed: 108 ins; 41 del; 63 mod

8291457: Clean up lifecycle of CDS dump-time data structures

Reviewed-by: coleenp, ccheung

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

PR: https://git.openjdk.org/jdk/pull/9722


More information about the hotspot-runtime-dev mailing list