diff --git a/include/alisp/sys.h b/include/alisp/sys.h index 6813a12..6e456dd 100644 --- a/include/alisp/sys.h +++ b/include/alisp/sys.h @@ -21,6 +21,7 @@ typedef struct void sys_init(sys_t *); lisp_t *sys_alloc(sys_t *, tag_t type); +void sys_delete(sys_t *, lisp_t *); void sys_free(sys_t *); // Debugging function: provides total memory usage from system. diff --git a/src/sys.c b/src/sys.c index 6bc8965..6578b18 100644 --- a/src/sys.c +++ b/src/sys.c @@ -34,6 +34,11 @@ lisp_t *sys_alloc(sys_t *sys, tag_t type) return NIL; } +void sys_delete(sys_t *sys, lisp_t *lisp) +{ + alloc_delete(&sys->memory, lisp); +} + u64 sys_cost(sys_t *sys) { return alloc_cost(&sys->memory) + sym_table_cost(&sys->symtable);