Set array size to simplify mem mgmt
aldarri_s at yahoo.com
Thu Jul 5 06:56:13 PDT 2007
Oskar Linde Wrote:
> Ald skrev:
> > Hello.
> > I have the following code:
> > char unitStack = new char;
> > unitStack.length = 0;
> > Does it make sense from viewpoint of simplifying memory management? If I enlarge the size, the array won't be reallocated?
> That is equivalent to reserving 256 chars. Enlarging the unitStack will
> not cause reallocation for at least the first 256 entries.
What sort of guarantee there is that the memory manager will not give the 127th through 255th chars to somebody else?
More information about the Digitalmars-d-learn