More radical ideas about gc and reference counting

Andrei Alexandrescu via Digitalmars-d digitalmars-d at
Wed Apr 30 15:58:17 PDT 2014

On 4/30/14, 3:54 PM, fra wrote:
> Can't do nothing but agree. Unless I'm missing something, no destructors
> means memory leaks every time I use non-class objects inside a class
> object.

If said non-class objects have destructors and are not cleaned up via 
other mechanisms.

> At least current behaviour makes sure that when memory is
> needed, everything gets cleaned up properly.

I think this was a false sense of security. There's no "making sure". 
Due to imprecision a destructor may or may not be called. Also, arrays 
of structs _never_ call destructors for their elements, which should 
shock you quite a bit more.

> Honestly, this sounds crazy
> to me.


Yes, radical. Because we want to uproot some bad weeds here.


More information about the Digitalmars-d mailing list