Dtnamic array memory allocation

Strtr strtr at spam.com
Thu Jan 7 21:41:50 PST 2010


Rob Adelberg Wrote:

> Does the dynamic array pre-allocate any memory?
> 
> I'm curious if the ~= on an array would be time sensitive. Would it make sense
> to allocate memory myself and then reset the length?
> 
> class A
> {
> uint [] array;
> :
>   this()
>   {
>      array = new uint [10];

or, "array.length = 10;"  ?

>      array.length = 0;
>   }
> }



More information about the Digitalmars-d-learn mailing list