[bytevm][wip] bytevm: allocate stack manually

wip tag because:

- we don't free tha stack (we use alloc_memory)
This commit is contained in:
Daniel Kochmański 2025-06-06 15:15:48 +02:00
parent 08f809d2f8
commit d1241fbe02
2 changed files with 18 additions and 4 deletions

View file

@ -181,16 +181,22 @@ ecl_lex_env_get_record(cl_object env, int s)
/* -- Lexical and local env operators ------------------------------------------ */
static cl_object
make_lex(cl_index n)
make_lex(cl_index size)
{
return si_make_vector(ECL_T, ecl_make_fixnum(n), ECL_NIL,
ecl_make_fixnum(0), ECL_NIL, ECL_NIL);
cl_object x = ecl_alloc_object(t_vector);
x->vector.elttype = ecl_aet_object;
x->vector.displaced = ECL_NIL;
x->vector.dim = size;
x->vector.fillp = 0;
x->vector.flags = ECL_FLAG_ADJUSTABLE | ECL_FLAG_HAS_FILL_POINTER;
x->vector.self.t = (cl_object *)ecl_alloc(size * sizeof(cl_object));
return x;
}
static void
push_lex(cl_object stack, cl_object new)
{
cl_vector_push(new, stack);
ecl_stack_push(stack, new);
}
/* -------------------- AIDS TO THE INTERPRETER -------------------- */

View file

@ -338,6 +338,13 @@ standard_finalizer(cl_object o)
case t_weak_pointer:
GC_unregister_disappearing_link((void**)&(o->weak.value));
break;
#if 0
case t_bclosure: {
ecl_free_stack(o->bclosure.lex);
o->bclosure.lex = ECL_NIL;
break;
}
#endif
#ifdef ECL_THREADS
case t_lock: {
const cl_env_ptr the_env = ecl_process_env();
@ -398,6 +405,7 @@ standard_finalizer(cl_object o)
ecl_atomic_push(&ecl_core.reused_indices, ecl_make_fixnum(o->symbol.binding));
o->symbol.binding = ECL_MISSING_SPECIAL_BINDING;
}
break;
}
#endif /* ECL_THREADS */
default:;