Am 27.12.2011, 03:42 Uhr, schrieb Marco Leise <marco.le...@gmx.de>:

Am 21.12.2011, 07:11 Uhr, schrieb Walter Bright <newshou...@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!

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];
}

It seems not to do so with *both* of these declarations, that create static arrays in the module:

byte abcd[10 * 1024 * 1024];
__gshared byte abcd[10 * 1024 * 1024];

Reply via email to