Re: Dtnamic array memory allocation

2010-01-07 Thread Strtr
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,

Dtnamic array memory allocation

2010-01-07 Thread Rob Adelberg
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]; array.length = 0; } }

Re: Are scope class useful ?

2010-01-07 Thread bearophile
div0: > I also use scope classes for storing intermediate results in complex > algorithms when I want deterministic collection. Use scope classes > and it all gets cleaned up when the algorithm finishes. Currently scopes objects can be useful as a performance optimization too. They (when possible