Allocate N elements

Adam D. Ruppe destructionator at gmail.com
Mon Jul 15 11:29:11 PDT 2013


On Monday, 15 July 2013 at 18:16:45 UTC, Namespace wrote:
> writeln(arr.length, "::", arr.capacity);

arr.capacity checks the GC block, and since you malloced it, 
there is no gc block for it to check. So it simply doesn't know 
if there's any extra capacity there and reports 0 just to be safe.



More information about the Digitalmars-d-learn mailing list