Why is the class ._dtor symbol not virtual?
12345swordy
alexanderheistermann at gmail.com
Thu Mar 29 15:09:49 UTC 2018
On Thursday, 29 March 2018 at 01:59:11 UTC, Jonathan M Davis
wrote:
> On Wednesday, March 28, 2018 20:17:28 12345swordy via
> Digitalmars-d wrote:
>> [...]
>
> I think that this is the first that I've heard of them not
> being virtual, but if I had to guess, the reason is that class
> finalizers are called by the GC, and their TypeInfo is probably
> used, which would make it unnecessary for the finalizer to be
> virtual, because it would always be called directly rather than
> through a base class reference. But that's just a guess.
>
> [...]
Honesty the finalizer and destructor should be split up if we
introduce memory allocation without the GC, as finalizer is
something that the GC uses and shouldn't be touch by anything
else.
I wish they give us some a little overview with ProtoObject.
More information about the Digitalmars-d
mailing list