Dtnamic array memory allocation

Rob Adelberg adelmetz at mindspring.com
Thu Jan 7 20:32:21 PST 2010


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;
  }
}


More information about the Digitalmars-d-learn mailing list