On Wednesday, 24 August 2016 at 08:34:24 UTC, rikki cattermole
wrote:
You're welcome to fix optlink
https://github.com/DigitalMars/optlink
Or write a whole new linker.
Of course there is no reason to not change this for -m32mscoff
and -m64 on Windows at least that I am aware of.
I'm running on linux with gold linker. No such issues. But the
point is totally different -- if it's a linker issue, let the
linker fail. Not the compiler.
Anyway, #FML:
struct BigArray(T, size_t N) {
mixin((){
enum arraySizeLimit = 16*1024*1024 - 1;
enum numFullChunks = (T.sizeof * N) / arraySizeLimit;
enum elemsPerFullChunk = arraySizeLimit / T.sizeof;
enum elemsPerLastChunk = N - numFullChunks *
elemsPerFullChunk;
static assert (elemsPerLastChunk <= elemsPerFullChunk);
string s = "";
size_t covered;
foreach(i; 0 .. numFullChunks) {
s ~= "T[%s] arr%s;\n".format(elemsPerFullChunk, i);
}
s ~= "T[%s] arr%s;\n".format(elemsPerLastChunk,
numFullChunks);
return s;
}());
enum length = N;
@property T* ptr() {
return arr0.ptr;
}
@property T[] slice() {
return arr0.ptr[0 .. N];
}
alias slice this;
}