Fixed heap init

This commit is contained in:
Justin Ethier 2015-11-13 02:39:22 -05:00
parent 149aea2c0a
commit df53ec99a6
3 changed files with 7 additions and 1 deletions

View file

@ -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();
}

View file

@ -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);

View file

@ -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;