aboutsummaryrefslogtreecommitdiff
path: root/tag.c
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2025-08-20 23:27:04 +0100
committerAryadev Chavali <aryadev@aryadevchavali.com>2025-08-20 23:37:08 +0100
commit847eb1a69b54da3a5d686922f0a2fcd8ab37f1e6 (patch)
tree057d4c1ca6f478a2909d0ee271d2bb8ff0f25c2f /tag.c
parent13142dc7f38e6b148efadc97edffca8664b9cde7 (diff)
downloadalisp-847eb1a69b54da3a5d686922f0a2fcd8ab37f1e6.tar.gz
alisp-847eb1a69b54da3a5d686922f0a2fcd8ab37f1e6.tar.bz2
alisp-847eb1a69b54da3a5d686922f0a2fcd8ab37f1e6.zip
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.
Diffstat (limited to 'tag.c')
-rw-r--r--tag.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/tag.c b/tag.c
index 874d532..8ca688a 100644
--- a/tag.c
+++ b/tag.c
@@ -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)