Thanks for the clarifications.
On Saturday, 11 February 2017 at 00:16:04 UTC, sarn wrote:
If you explicitly initialise the array to all 0.0, you should
see it disappear from the binary.
I was actually wondering whether initialisation would make a
difference, so thank you for this.
Bastiaan.
On Friday, 10 February 2017 at 15:12:28 UTC, Jonathan M Davis
wrote:
Module-level and static variables all get put in the
executable. So, declaring a static array like that is going to
take up space. A dynamic array would do the same thing if you
gave it a value of that size. The same thing hap
On Friday, February 10, 2017 11:21:48 Bastiaan Veelo via Digitalmars-d-learn
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.
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
by
// 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