On Monday, 15 July 2013 at 18:29:12 UTC, Adam D. Ruppe wrote:
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.

Ah, good to know. But anyway malloc allocates exact N elements, without ugly overhead. Would be really good if there was a way to avoid that the GC takes over the memory.

Reply via email to