core: Fix FRAME_SIZE conflict.
This avoids conflicting with FRAME_SIZE from signal.h. * include/mes/constants.h (FRAME_SIZE): Rename to... (GC_FRAME_SIZE): ...this. (FRAME_PROCEDURE): Rename to... (GC_FRAME_PROCEDURE): ...this. * src/eval-apply.c (eval_apply): Update accordingly. * src/gc.c (gc_push_frame, gc_peek_frame, gc_pop_frame): Update accordingly. * src/stack.c (make_frame, make_stack): Update accordingly.
This commit is contained in:
parent
72e371d77f
commit
8920f558c6
|
@ -68,10 +68,10 @@
|
|||
// CONSTANT STRUCT_PRINTER 1
|
||||
#define STRUCT_PRINTER 1
|
||||
|
||||
// CONSTANT FRAME_SIZE 5
|
||||
#define FRAME_SIZE 5
|
||||
// CONSTANT FRAME_PROCEDURE 4
|
||||
#define FRAME_PROCEDURE 4
|
||||
// CONSTANT GC_FRAME_SIZE 5
|
||||
#define GC_FRAME_SIZE 5
|
||||
// CONSTANT GC_FRAME_PROCEDURE 4
|
||||
#define GC_FRAME_PROCEDURE 4
|
||||
|
||||
// CONSTANT STDIN 0
|
||||
// CONSTANT STDOUT 1
|
||||
|
|
|
@ -441,7 +441,7 @@ evlis3:
|
|||
goto vm_return;
|
||||
|
||||
apply:
|
||||
g_stack_array[g_stack + FRAME_PROCEDURE] = R1->car;
|
||||
g_stack_array[g_stack + GC_FRAME_PROCEDURE] = R1->car;
|
||||
a = R1->car;
|
||||
t = a->type;
|
||||
if (t == TSTRUCT && builtin_p (R1->car) == cell_t)
|
||||
|
|
8
src/gc.c
8
src/gc.c
|
@ -694,14 +694,14 @@ gc ()
|
|||
void
|
||||
gc_push_frame ()
|
||||
{
|
||||
if (g_stack < FRAME_SIZE)
|
||||
if (g_stack < GC_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 - FRAME_SIZE;
|
||||
g_stack = g_stack - GC_FRAME_SIZE;
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -711,14 +711,14 @@ gc_peek_frame ()
|
|||
R2 = g_stack_array[g_stack + 1];
|
||||
R1 = g_stack_array[g_stack + 2];
|
||||
R0 = g_stack_array[g_stack + 3];
|
||||
g_stack_array[g_stack + FRAME_PROCEDURE];
|
||||
g_stack_array[g_stack + GC_FRAME_PROCEDURE];
|
||||
}
|
||||
|
||||
void
|
||||
gc_pop_frame ()
|
||||
{
|
||||
gc_peek_frame ();
|
||||
g_stack = g_stack + FRAME_SIZE;
|
||||
g_stack = g_stack + GC_FRAME_SIZE;
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -53,8 +53,8 @@ make_frame (struct scm *stack, long index)
|
|||
struct scm *procedure = 0;
|
||||
if (index != 0)
|
||||
{
|
||||
array_index = (STACK_SIZE - (index * FRAME_SIZE));
|
||||
procedure = g_stack_array[array_index + FRAME_PROCEDURE];
|
||||
array_index = (STACK_SIZE - (index * GC_FRAME_SIZE));
|
||||
procedure = g_stack_array[array_index + GC_FRAME_PROCEDURE];
|
||||
}
|
||||
if (procedure == 0)
|
||||
procedure = cell_f;
|
||||
|
@ -78,7 +78,7 @@ struct scm *
|
|||
make_stack (struct scm *stack) /*:((arity . n)) */
|
||||
{
|
||||
struct scm *stack_type = make_stack_type ();
|
||||
long size = (STACK_SIZE - g_stack) / FRAME_SIZE;
|
||||
long size = (STACK_SIZE - g_stack) / GC_FRAME_SIZE;
|
||||
struct scm *frames = make_vector_ (size, cell_unspecified);
|
||||
long i;
|
||||
struct scm* frame;
|
||||
|
|
Loading…
Reference in a new issue