Refactor vectors to SBO, removing inlined entirely.

Avoid 2 levels of indirection, and having to allocate twice for small
payloads, by having an inlined array on the vector directly!
Beautiful and simple.

Required a bit of refactoring around the board, but overall the result
makes me feel happier.
This commit is contained in:
2025-08-20 23:27:04 +01:00
parent 13142dc7f3
commit 847eb1a69b
7 changed files with 92 additions and 131 deletions

6
tag.c
View File

@@ -22,7 +22,7 @@ lisp_t *tag_int(i64 i)
return TAG((u64)i, INT);
}
lisp_t *tag_sym(sv_t *str)
lisp_t *tag_sym(char *str)
{
return TAG((u64)str, SYM);
}
@@ -57,10 +57,10 @@ i64 as_int(lisp_t *obj)
;
}
sv_t *as_sym(lisp_t *obj)
char *as_sym(lisp_t *obj)
{
assert(IS_TAG(obj, SYM));
return (sv_t *)UNTAG(obj, SYM);
return (char *)UNTAG(obj, SYM);
}
cons_t *as_cons(lisp_t *obj)