core: gc: FRAME_SIZE.

* src/gc.c (gc_loop, gc_): Use FRAME_SIZE.
This commit is contained in:
Jan (janneke) Nieuwenhuizen 2020-06-22 19:26:55 +02:00
parent c6670b46c3
commit 52c57da02f
No known key found for this signature in database
GPG key ID: F3C1A0D9C1D65273
2 changed files with 14 additions and 16 deletions

View file

@ -81,9 +81,6 @@ SCM builtin_name (SCM builtin);
SCM cstring_to_list (char const *s);
SCM cstring_to_symbol (char const *s);
SCM fdisplay_ (SCM, int, int);
SCM gc_peek_frame ();
SCM gc_pop_frame ();
SCM gc_push_frame ();
SCM init_symbols ();
SCM init_time (SCM a);
SCM make_builtin_type ();
@ -119,6 +116,9 @@ void assert_max_string (size_t i, char const *msg, char *string);
void assert_msg (int check, char *msg);
void gc_ ();
void gc_init ();
void gc_peek_frame ();
void gc_pop_frame ();
void gc_push_frame ();
#include "mes/builtins.h"
#include "mes/constants.h"

View file

@ -440,34 +440,32 @@ gc ()
return cell_unspecified;
}
SCM
gc_push_frame () /*:((internal)) */
void
gc_push_frame ()
{
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;
return g_stack;
g_stack = g_stack - FRAME_SIZE;
}
SCM
gc_peek_frame () /*:((internal)) */
void
gc_peek_frame ()
{
R3 = g_stack_array[g_stack];
R2 = g_stack_array[g_stack + 1];
R1 = g_stack_array[g_stack + 2];
R0 = g_stack_array[g_stack + 3];
return g_stack_array[g_stack + FRAME_PROCEDURE];
g_stack_array[g_stack + FRAME_PROCEDURE];
}
SCM
gc_pop_frame () /*:((internal)) */
void
gc_pop_frame ()
{
SCM x = gc_peek_frame ();
g_stack = g_stack + 5;
return x;
gc_peek_frame ();
g_stack = g_stack + FRAME_SIZE;
}