Allocate N elements

Namespace rswhite4 at googlemail.com
Mon Jul 15 04:46:52 PDT 2013


Is there no way (besides the ugly malloc or any wrappers) to 
allocate _exactly_ N elements at runtime (no static array)?
I tried
----
int[] arr = new int[sizeOfItems];
----
but if sizeOfItems is e.g. 512, it allocates 1024.
So is there no way to allocate a fixed memory block without the 
usage of C functions?


More information about the Digitalmars-d-learn mailing list