This commit is contained in:
2026-05-13 08:13:07 -05:00
parent 7501c74712
commit 86858ef26f
4 changed files with 34 additions and 6 deletions

View File

@@ -134,4 +134,15 @@ TYC_RESULT stack_pop_fp(Stack* s)
size_t stack_fp_level(Stack* s)
{
return s->fp_n;
}
}
size_t stack_collectable_array(Stack* s, VALUE** values)
{
size_t j = 0;
*values = xmalloc(stack_len(s) * sizeof(VALUE));
for (size_t i = 0; i < s->stack_n; ++i)
if (type_is_collectable(s->stack[i].type))
(*values)[j++] = s->stack[i];
return j;
}