dmd 1.057 and 2.041 release
Walter Bright
newshound1 at digitalmars.com
Mon Mar 8 12:12:58 PST 2010
bearophile wrote:
> Note: this produces the same very large binary, I don't know why:
>
> double[100_000] arr = void;
> static this() {
> arr[] = typeof(arr[0]).init;
> }
> void main() {}
obj2asm tells the tale. (obj2asm is an incredibly useful tool, I don't
know why nobody uses it.)
double[100_000] arr = void;
puts arr in the thread local storage segment. Unfortunately, there is no
bss for TLS.
__gshared double[100_000] arr = void;
puts arr in the BSS segment, which takes up space in your executable but
not the executable *file*.
More information about the Digitalmars-d-announce
mailing list