On Tue, Jun 18, 2019 at 2:30 PM lili via Digitalmars-d-learn <
digitalmars-d-learn@puremagic.com> wrote:

> Hi guys:
>     Is the Dlang fix-length array alloc on stack?  when a test
>      writeln([1]).sizeof //16
>      writeln([2]).sizeof //16
>      Why, What is the fix-length array memory layout.
>

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

Reply via email to