3 ms·
Even without abusing preprocessor or C++ templates you do something as simple as global array char a[1ULL<<30]={1}; Initialize at least one member so that it g
by Karliss 6y ago
Even without abusing preprocessor or C++ templates you do something as simple as global array char a[1ULL<<30]={1};
Initialize at least one member so that it gets placed in data section instead of bss resulting in binary size more or less the same as array. Although at least on my system various parts of toolchain start to break down once you reach 2GB limit.
- shakna 6y agoThe plain C equivalent to the above, changing the "command" part to be something valid: const main[255<<21]={195}; You can also get around the 2Gb limit by using the -mcmodel flag, such as 'gcc -mcmodel=medium FILE'. But then actually compiling the thing takes a long time and a heck of a lot of memory: const main[-1u]={195};