[Issue 21136] N sized array takes kN bytes in executable file

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sat Aug 8 09:31:46 UTC 2020


https://issues.dlang.org/show_bug.cgi?id=21136

KytoDragon <kytodragon at e.mail.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |kytodragon at e.mail.de

--- Comment #1 from KytoDragon <kytodragon at e.mail.de> ---
These sizes all look correct.
byte, bool and int initialize to zero, so they don't need to be explicitly
stored in the resulting executable. 1000000 chars need 1000000 bytes, floats
use 4 bytes each so need 4000000 bytes total and double use 8 bytes each,
resulting in a total of 8000000 bytes.
The remaining ~16k bytes are just the code and metadata of the executable.

--


More information about the Digitalmars-d-bugs mailing list