Program size, linking matter, and static this()

Walter Bright newshound2 at digitalmars.com
Tue Dec 20 22:11:10 PST 2011


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.


More information about the Digitalmars-d mailing list