RFR: 8139200: Eliminate G1ParClosureSuper::_worker_id
Kim Barrett
kim.barrett at oracle.com
Fri Oct 9 15:16:34 UTC 2015
On Oct 9, 2015, at 4:29 AM, Mikael Gerdin <mikael.gerdin at oracle.com> wrote:
>
>> CR:
>> https://bugs.openjdk.java.net/browse/JDK-8139200
>>
>> Webrev:
>> http://cr.openjdk.java.net/~kbarrett/8139200/webrev.00/
>
> Nice cleanup!
> I noticed that you introduced empty destructors for G1ParClosureSuper and G1ParCopyHelper, is there a particular reason for that?
Non-public destructors are a way to prevent slicing problems. For me
it's a nearly automatic defensive programming mechanism. I don't
expect to find existing problems in our code base, but it means one
never needs to spend time even thinking about the possibility of such
problems. [The usual rule for base class destructors is either public
and virtual, or protected. [Though I've seen a good use of protected
virtual.] We don't need virtual destructors in the Closure hierarchy,
since we never heap allocate and then delete through a base class
pointer.]
More information about the hotspot-gc-dev
mailing list