Program size, linking matter, and static this()

Marco Leise Marco.Leise at gmx.de
Mon Dec 26 18:42:47 PST 2011


Am 21.12.2011, 07:11 Uhr, schrieb Walter Bright  
<newshound2 at digitalmars.com>:

> On 12/20/2011 5:52 PM, Marco Leise wrote:
>> Ok, I jumped on the band wagon to early. Personally I only had this  
>> problem with
>> classes and structs.
>>
>> struct Test {
>> byte arr[1024 * 1024 *10];
>> }
>>
>> and
>>
>> class Test {
>> byte arr[1024 * 1024 *10];
>> }
>>
>> both create a 10MB executable. While for the class, init may contain  
>> more data
>> than just that one field, I don't see the struct adding anything or  
>> going into
>> TLS. Can these initializers also go into .bss?
>
> The struct one already does. Compile it, obj2asm it, and you'll see it  
> there.

Ah, I see it now. Sorry for the noise!


More information about the Digitalmars-d mailing list