core: gc: FRAME_SIZE.

* src/gc.c (FRAME_SIZE): New constant.
(gc_loop, gc_): Use it.
This commit is contained in:
Jan Nieuwenhuizen 2019-10-28 18:26:55 +01:00
parent 762d084e5e
commit 1c6077e1cb
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
1 changed files with 5 additions and 13 deletions

View File

@ -25,16 +25,8 @@
#include <string.h>
#include <stdlib.h>
// long ARENA_SIZE;
// long MAX_ARENA_SIZE;
// long STACK_SIZE;
// long JAM_SIZE;
// long GC_SAFETY;
// long MAX_STRING;
// char *g_arena;
// long g_free;
void init_symbols_ ();
// CONSTANT FRAME_SIZE 5
#define FRAME_SIZE 5
#if __M2_PLANET__
#define M2_CELL_SIZE 12
@ -594,14 +586,14 @@ gc ()
SCM
gc_push_frame () /*:((internal)) */
{
if (g_stack < 5)
if (g_stack < FRAME_SIZE)
assert_msg (0, "STACK FULL");
g_stack_array[g_stack - 1] = cell_f;
g_stack_array[g_stack - 2] = R0;
g_stack_array[g_stack - 3] = R1;
g_stack_array[g_stack - 4] = R2;
g_stack_array[g_stack - 5] = R3;
g_stack = g_stack - 5;
g_stack = g_stack - FRAME_SIZE;
return g_stack;
}
@ -619,6 +611,6 @@ SCM
gc_pop_frame () /*:((internal)) */
{
SCM x = gc_peek_frame ();
g_stack = g_stack + 5;
g_stack = g_stack + FRAME_SIZE;
return x;
}