On Thu, Nov 6, 2008 at 2:02 PM, Big Bill <[EMAIL PROTECTED]> wrote: > i just wonder here, > > free(x); will free contents of x, but will x.length=0 free memory too?
No it does not, and this is how you can implement a "reserve_capacity"
kind of function for D arrays.
void reserve_capacity(T)(ref T[] a, size_t N) {
size_t orig_length = a.length;
if (orig_length >= N) return;
a.length = N;
a.length = orig_length;
}
