1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-13 17:20:21 +02:00

Ability to set heap size on command line

This commit is contained in:
Andy Wingo 2022-03-10 16:47:52 +01:00
parent 5edc4fa81a
commit f6ac9d2571

View file

@ -230,6 +230,13 @@ int main() {
double kHeapMultiplier = 3;
size_t kHeapSize = kHeapMaxLive * kHeapMultiplier;
if (getenv("HEAP_SIZE"))
kHeapSize = atol(getenv("HEAP_SIZE"));
if (!kHeapSize) {
fprintf(stderr, "Failed to parse HEAP_SIZE='%s'\n", getenv("HEAP_SIZE"));
return 1;
}
struct context _cx;
struct context *cx = &_cx;
initialize_gc(cx, kHeapSize);