Summary: Array initialization generates garbage
--- Comment #0 from Malte Skarupke <malteskaru...@web.de> 2012-10-14 11:23:55
Array initialization currently generates garbage that needs to be collected by
int a = [1, 2, 3, 4, 5]; // generates garbage
foreach (i; 0 .. 5)
a[i] = i + 1;
} // same thing, but no garbage. everything is on the stack
Creating an array on the stack should be a trivial and fast operation. Yet
stepping through the disassembly of that first line reveals a lot of overhead.
But for now all I want fixed is that the first line does not generate garbage.
The reason for why it generates garbage is that it allocates on the heap, then
memcpys over to the stack, and never cleans up the memory on the heap.
It should obviously initialize directly on the stack.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------