potential speed improvement for repeated string concatenation

Serg Kovrov sergk at mailinator.com
Thu Aug 2 07:58:13 PDT 2007


janderson wrote:
> You can do this as well:
> 
> void reserve(T)(T[] array, int reserve)
> {
>     array.length += reserve;
>     array.length = 0;
> }
> 
> That way you can use char[] like normal.

Is it *guaranteed* that array.length=0 memory will not cause memory to 
be collected by GC?

--serg.



More information about the Digitalmars-d mailing list