Destructor nonsense on dlang.org

deadalnix deadalnix at gmail.com
Thu May 24 08:27:48 PDT 2012


Le 24/05/2012 16:54, Andrei Alexandrescu a écrit :
> On 5/24/12 9:28 AM, Alex Rønne Petersen wrote:
>> The GC should (and probably does) assume at shutdown that all objects
>> are unreferenced, and therefore reclaim and finalize them.
>
> They may refer to one another.
>
> Andrei
>

So what ?

Each GC passes must, mark object that have to be removed, call finalizer 
on them all, THEN recycle memory.

So « zombie » object can still refer to one another in finalization.

The real problem is resurrection, which should be 100% forbiden and this 
must be enforced by the language (ie, the scopeness of this parameter is 
something important).


More information about the Digitalmars-d mailing list