main/gc: Enable large config for heap size > 4GiB
I'm proposing to enable
LARGE_CONFIG setting for building libgc on 64-bit systems to enable heap sizes of more than 4 GiB.
LARGE_CONFIG Tunes the collector for unusually large heaps. Necessary for heaps larger than about 4 GiB on most (64-bit) machines. Recommended for heaps larger than about 500 MiB. Not recommended for embedded systems. Could be used in conjunction with SMALL_CONFIG to generate smaller code (by disabling incremental collection support, statistic printing and some optimization algorithms).
Depending on the use case, a heap size of 4+ GiB might actually not be that unusually large anymore.
We've had issues with large heaps in Crystal applications (Crystal runtime uses libgc), which meant the program would fail and is unusable for large amounts of data. This has even been a problem for the Crystal compiler. We now use libgc with
--enable-large-config in the generic distribution packages. But the aports package community/crystal uses libgc from main/gc-dev which currently does not use
LARGE_CONFIG. So it will inevitably run in to issues as well that have been witnessed on other platforms before. This could obviously be fixed by using a custom build libgc for Crystal package, but a) it's better to depend on the default package and b) other users of libgc might benefit from this change as well.