[Issue 1164] Wrong order of memory deallocation

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Tue Dec 27 02:35:05 PST 2016


https://issues.dlang.org/show_bug.cgi?id=1164

--- Comment #15 from safety0ff.bugz <safety0ff.bugz at gmail.com> ---
(In reply to Pieter Penninckx from comment #14)
>
> This just runs normally for me. But if I understand comment #13 correctly,
> this is just luck and I shouldn't count on it, especially when the runtime
> is compiled with the MEMSTOMP option.

MEMSTOMP is essentially a tool used for debugging memory corruption type
issues.
Compliant D code runs correctly regardless whether it is enable and I was using
it as an illustration of what is allowed in the runtime.

I don't know what is the official stance on referencing other GC managed memory
from invariant code.
Since it is automatically run before the destructor/finalizer, it violates the
spec.
This restriction is quite severe, it might be better if invariants aren't
called before the destructor.

--


More information about the Digitalmars-d-bugs mailing list