Program size, linking matter, and static this()

Marco Leise Marco.Leise at gmx.de
Wed Jan 18 02:43:45 PST 2012


Am 18.01.2012, 11:18 Uhr, schrieb Walter Bright  
<newshound2 at digitalmars.com>:

> On 1/18/2012 1:43 AM, Marco Leise wrote:
>> It is back again! The following struct in my main module increases the
>> executable size by 10MB with DMD 2.075:
>>
>> struct Test {
>> byte abcd[10 * 1024 * 1024];
>> }
>
> Compiling it and obj2asm'ing the result, and you'll see it goes into the  
> BSS segment:
>
>
> [...]
>
> Adding a void main(){} yields an executable of 145,948 bytes.

Thanks for checking back. I'll have to experiment a bit to narrow this one  
down. It comes and goes like a ghost. I was using Linux 64-bit and the  
switches -O -release on a medium size code base.


More information about the Digitalmars-d mailing list