More radical ideas about gc and reference counting

fra via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 09:04:59 PDT 2014


On Wednesday, 30 April 2014 at 20:21:33 UTC, Andrei Alexandrescu 
wrote:
> I think there's no need to argue that in this community. The GC 
> never guarantees calling destructors even today, so this 
> decision would be just a point in the definition space (albeit 
> an extreme one).

I think I (we) need a bit of clarification.
Docs in http://dlang.org/class.html#destructors states that: "The 
garbage collector calls the destructor function when the object 
is deleted."
As far as I understand, this means that destructors are always 
called when an instance is collected. Is this right?
Doesn't this mean that destructors are guaranteed to run for 
unreferenced objects if we force the GC to do a full collect 
cycle?


More information about the Digitalmars-d mailing list