gc: new cell_nil: nice

This commit is contained in:
Jan Nieuwenhuizen 2019-11-03 08:48:42 +01:00
parent f20e50f971
commit 431f3e610f
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 8 additions and 7 deletions

View File

@ -577,25 +577,26 @@ gc_ ()
gc_up_arena ();
}
#if POINTER_CELLS
SCM save_gfree = g_free;
#endif
SCM new_cell_nil = g_free;
SCM s;
for (s = cell_nil; s < g_symbol_max; s = s + M2_CELL_SIZE)
gc_copy (s);
#if POINTER_CELLS
cell_nil = new_cell_nil;
#if GC_TEST
cell_nil = save_gfree;
cell_zero = cell_nil - M2_CELL_SIZE;
g_symbol_max = g_free;
#else
long save_gsymbols = g_symbols;
cell_nil = save_gfree;
g_symbols = 0;
g_free = save_gfree;
g_free = new_cell_nil;
init_symbols_ ();
g_symbol_max = g_symbol;
g_symbols = save_gsymbols;
#endif
#endif
g_symbols = gc_copy (g_symbols);
@ -606,7 +607,7 @@ gc_ ()
for (i = g_stack; i < STACK_SIZE; i = i + 1)
copy_stack (i, gc_copy (g_stack_array[i]));
gc_loop (cell_nil);
gc_loop (new_cell_nil);
}
SCM