Go, D, and the GC

Kagamin via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 9 05:26:28 PDT 2015


On Friday, 9 October 2015 at 07:54:43 UTC, deadalnix wrote:
> It is also very useful as a safety net. When the object is 
> released, if it still hold handle to scarce resource, it make 
> sense to log and release it, or something similar. That is 
> surely better than running out of the resource and crashing.

Though it's a feature nice to have, not a resource management 
mechanism. In .net when an object is released it can suppress its 
finalizer, so it won't be considered for finalization during 
collection and will be collected as plain garbage. AFAIK in D GC 
finalization is accounted as a block flag, so to suppress 
finalization one can reset this flag, and the block will be 
collected without finalization.


More information about the Digitalmars-d mailing list