GC: memory collected but destructors not called

Marco Leise via Digitalmars-d digitalmars-d at puremagic.com
Mon Nov 10 06:40:56 PST 2014


Am Mon, 10 Nov 2014 09:13:09 +0000
schrieb "Tomer Filiba" <tomerfiliba at gmail.com>:

> Thanks for the info, ketmar.
> 
> By the way, what do you guys think of adding @nogc to structs, in 
> which case they cannot be instantiated by the GC?
> 
> e.g.,
> 
> @nogc struct S {...}
> auto s = new S(); // does not compile
> S s;              // all is well
> 
> 
> -tomer

That collides with the use of @nogc on S to mean that this
struct itself wont use the GC, but may be used in a GC
context, like as part of a class allocated on the GC heap.
Well, in general it means "does not call GC functions".

-- 
Marco



More information about the Digitalmars-d mailing list