Static Constructors
Saaa
empty at needmail.com
Sat Oct 4 12:11:29 PDT 2008
> If you want the memory removed as soon as possible, you should zero out
> the
> last element, otherwise, the GC will still think the element is being
> pointed to:
>
> data[n] = data[$-1];
> data[$-1] = null;
> data.length = data.length - 1;
>
> -Steve
Because the GC sees all allocated memory as used and an array doesn't
deallocate memory when made smaller?
Or just delete it :)
More information about the Digitalmars-d-learn
mailing list