Mem Mgmt: With & Without the GC
Cauterite via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Aug 21 09:50:01 PDT 2016
On Sunday, 21 August 2016 at 16:14:53 UTC, Zane wrote:
> 2) Does calling object.destroy() mean that the object is marked
> for future collection? If not, how can I ensure it is properly
> marked.
Because the GC is not of the incremental type, it can't perform
any marking outside of a stop-the-world mark/sweep cycle.
Instead, what `destroy()` does is finalise an object: that is,
runs any destructors and puts it in an invalid state — in
particular, all pointers contained within the object are
nullified, so it doesn't reference any other objects.
When I say 'object' I mean anything; class instance, structure,
array, primitive, whatever.
More information about the Digitalmars-d-learn
mailing list