Make GC.free a no-op during a collection cycle?

Andrei Alexandrescu via Digitalmars-d digitalmars-d at puremagic.com
Wed Feb 25 15:28:46 PST 2015


Several discussions (including the recent one on RCSlice) mentioned the 
fact that calling GC.free inside a destructor may lead to double freeing 
of memory.

One simple solution is to simply have GC.free return immediately if 
called inside a collection. Nothing good could come of the call anyway.

Would this work? Any impediments?


Andrei


More information about the Digitalmars-d mailing list