Where can find fix length array memory layout document

Daniel Kozak kozzi11 at gmail.com
Tue Jun 18 12:36:34 UTC 2019


import std.stdio;
import std.array : staticArray;


void main() {
    writeln([1].staticArray.sizeof); //4
    writeln([2,5].staticArray.sizeof); //8
}

On Tue, Jun 18, 2019 at 2:30 PM lili via Digitalmars-d-learn <
digitalmars-d-learn at 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.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20190618/bcdab7d1/attachment.html>


More information about the Digitalmars-d-learn mailing list