diff --git a/include/cyclone/runtime-main.h b/include/cyclone/runtime-main.h index 2ab0b1ab..a0487d0f 100644 --- a/include/cyclone/runtime-main.h +++ b/include/cyclone/runtime-main.h @@ -27,7 +27,7 @@ static void Cyc_heap_init(long heap_size) #if DEBUG_SHOW_DIAG printf("main: Allocating and initializing heap...\n"); #endif - Cyc_heap = gc_heap_create(heap_size / 2, 0, 0); + gc_init_heap(); gc_init_mutators(); gc_start_collector(); } diff --git a/include/cyclone/runtime.h b/include/cyclone/runtime.h index 9c287782..03475028 100644 --- a/include/cyclone/runtime.h +++ b/include/cyclone/runtime.h @@ -84,6 +84,7 @@ object cell_get(object cell); extern object Cyc_global_variables; int _cyc_argc; char **_cyc_argv; +void Cyc_init_heap(long heap_size); object Cyc_get_global_variables(); object Cyc_get_cvar(object var); object Cyc_set_cvar(object var, object value); diff --git a/runtime.c b/runtime.c index e8f9dfd6..e8fc4d5e 100644 --- a/runtime.c +++ b/runtime.c @@ -90,6 +90,11 @@ char **_cyc_argv = NULL; static symbol_type __EOF = {{0}, eof_tag, "", nil}; // symbol_type in lieu of custom type const object Cyc_EOF = &__EOF; +void Cyc_init_heap(long heap_size) +{ + Cyc_heap = gc_heap_create(heap_size, 0, 0); +} + gc_heap *Cyc_get_heap() { return Cyc_heap;