lisp: split memory into conses and vectors

During garbage collection, we'll iterate through these two vectors.
Instead of freeing the memory, we can swap cells in the vector and
decrement its size.

The idea is we can attach an allocator to the system where we reuse
memory instead of just allocating everytime.
This commit is contained in:
2026-02-12 05:39:51 +00:00
committed by oreodave
parent 7df292ed9e
commit c1cdb8607d
3 changed files with 51 additions and 26 deletions

View File

@@ -26,7 +26,8 @@ typedef struct
/// System context
typedef struct
{
vec_t memory;
vec_t conses;
vec_t vectors;
sym_table_t symtable;
} sys_t;