<div dir="ltr"><div dir="ltr">On Tue, Jun 18, 2019 at 2:30 PM lili via Digitalmars-d-learn <<a href="mailto:digitalmars-d-learn@puremagic.com">digitalmars-d-learn@puremagic.com</a>> wrote:<br></div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi guys:<br>
Is the Dlang fix-length array alloc on stack? when a test<br>
writeln([1]).sizeof //16<br>
writeln([2]).sizeof //16<br>
Why, What is the fix-length array memory layout.<br></blockquote><div><br></div><div>When you do [1] without staticArray it will be automaticaly change to array slice which consist of pointer to data (8bytes on 64bit) and length of array again 8byte on 64bit </div></div></div>