Huge allocations are mistreated by the GC, e.g.
import core.memory;
import std.stdio;
void main()
{
size_t sz = 2L^^32;
auto ptr = GC.malloc(sz);
auto info = GC.query(ptr);
writeln(info);
assert(info.size >= sz);
}
>dmd -m64 -run test.d
BlkInfo_(1F953FE0000, 0, 0)
[email protected](10): Assertion failure
=> The returned size is reported as 0.
The problem ist that the size of large allocations are stored in a uint-array bPageOffsets, which causes bPageOffsets[p]*PAGESIZE to overflow.
Comment #1 by github-bugzilla — 2018-12-30T02:42:17Z