On Monday, 21 October 2013 at 21:41:24 UTC, Iain Buclaw wrote:
I know this, but it does deter me against changing gdc over to stack
allocating array literals. :-)

I'll mull on it over night.

There is no change in behaviour due to stack-allocating the literal in the static array assignment (or just not emitting it at all), at least if GDC correctly implements slice <- sarray assignment. The dynamic array never "sees" the literal at all, as shown by Timon.

In the general case (i.e. when assigned to dynamic arrays), you obviously can't stack-allocate literals, but I don't think we disagree here.

David

Reply via email to