More radical ideas about gc and reference counting

monarch_dodra via Digitalmars-d digitalmars-d at puremagic.com
Fri May 2 14:03:15 PDT 2014


On Friday, 2 May 2014 at 15:06:59 UTC, Andrei Alexandrescu wrote:
> So now it looks like dynamic arrays also can't contain structs 
> with destructors :o). -- Andrei

Well, that's always been the case, and even worst, since in a 
dynamic array, destructor are guaranteed to *never* be run. 
Furthermore, given the "append causes relocation which 
duplicates", you are almost *guaranteed* to leak your 
destructors. You just can't keep track of the usage of a "naked" 
dynamic array.

This usually comes as a great surprise to users in ".learn". It's 
also the reason why using "File[]" never ends well...


More information about the Digitalmars-d mailing list