RFR: 8282763: G1: G1CardSetContainer remove intrusive-list details. [v3]

Albert Mingkun Yang ayang at openjdk.java.net
Thu Mar 10 22:20:39 UTC 2022


On Thu, 10 Mar 2022 17:19:42 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:

>> src/hotspot/share/gc/g1/g1CardSetContainers.hpp line 146:
>> 
>>> 144:   uintptr_t _ref_count;
>>> 145: protected:
>>> 146:   ~G1CardSetContainer() = default;
>> 
>> I think the destructor can be omitted completely.
>
> Omitting this destructor declaration would make the destructor implicitly public, which would make accidental slicing possible.

Got it; TIL: "The destructor for a base class should be public and virtual or non-public and non-virtual."

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

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



More information about the hotspot-gc-dev mailing list