Finalizing GC
H. S. Teoh
hsteoh at quickfur.ath.cx
Sun Mar 31 20:51:52 PDT 2013
On Sun, Mar 31, 2013 at 06:29:21PM -0700, Jonathan M Davis wrote:
[...]
> It's my understanding that structs don't get finalized, because the
> type information isn't there at runtime to do it. I don't know if that
> can be gotten around or not, but my guess is that it's a permanent
> restriction unless we start putting invisible member variables in
> structs which have that information. I don't know though. Classes, on
> the other hand, hold information on their actual types at runtime, so
> the information is there to finalize them.
>
> But regardless, there is _no_ guarantee that _anything_ on the GC heap
> will ever be finalized, so any program which relies on anything on the
> GC heap being finalized is buggy by definition, and I don't expect
> that to ever change.
[...]
So what's the point of having class dtors then?!
T
--
Being able to learn is a great learning; being able to unlearn is a greater learning.
More information about the Digitalmars-d-learn
mailing list