Partial arrays reclaimed?

Nick Sabalausky via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jan 27 15:22:17 PST 2017


Suppose an array is being used like a FIFO:

-----------------------
T[] slice;

// Add:
slice ~= T();

// Remove:
slice = slice[1..$];
-----------------------

Assuming of course there's no other references to the memory, as this 
gets used, does the any of the memory from the removed elements ever get 
GC'd?

Also, if this is a long-running process, isn't there a potential danger 
in the array just marching through the address space and running out of 
room? (ie either running out of of continuous space, or hitting 0xFFF....)


More information about the Digitalmars-d-learn mailing list