GC has a "barbaric" destroyng model, I think

Jonathan M Davis via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Thu Feb 12 00:55:33 PST 2015


On Thursday, February 12, 2015 08:33:34 Kagamin via Digitalmars-d-learn wrote:
> Truth be told, D has no guideline for deterministic destruction
> of managed resources.

Really what it comes down to is that if you want deterministic destruction,
you _don't_ use managed resources. You use malloc and free rather than new
and the GC. Granted, that's way uglier than it should be right now, because
the allocator stuff hasn't been finished yet, but it's really what's
required if you want an object on the heap to have a deterministic lifetime.
Memory that's managed by a GC just doesn't work that way.

- Jonathan M Davis



More information about the Digitalmars-d-learn mailing list