Why do static arrays affect executable size?
Stefan Koch via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Feb 10 03:24:47 PST 2017
On Friday, 10 February 2017 at 11:21:48 UTC, Bastiaan Veelo wrote:
> // enum int maxarray = 0;
> enum int maxarray = 2_000_000;
>
> double[maxarray] a, b, c, d;
>
> void main() {}
>
>
> Compiled using "dub build --arch=x86_64 --build=release" on
> Windows (DMD32 D Compiler v2.073.0), the exe size is 302_592
> bytes v.s. 64_302_592 bytes, depending on the array length.
>
> Is that normal?
Yes.
More information about the Digitalmars-d-learn
mailing list