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:
parent
5edc4fa81a
commit
f6ac9d2571
1 changed files with 7 additions and 0 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue