diff --git a/include/mes/mes.h b/include/mes/mes.h index 1e94def9..ea5d7e56 100644 --- a/include/mes/mes.h +++ b/include/mes/mes.h @@ -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" diff --git a/src/gc.c b/src/gc.c index 4bac1513..debf8b3d 100644 --- a/src/gc.c +++ b/src/gc.c @@ -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; }