diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-08-20 22:43:23 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-08-20 22:43:23 +0100 |
commit | 13142dc7f38e6b148efadc97edffca8664b9cde7 (patch) | |
tree | 068eb442645caf65e2ac2ff0a4d5f44f158c5a88 /alisp.h | |
parent | 6e2db6825d4ff4b57be3086f654a84cc9ff64bcf (diff) | |
download | alisp-13142dc7f38e6b148efadc97edffca8664b9cde7.tar.gz alisp-13142dc7f38e6b148efadc97edffca8664b9cde7.tar.bz2 alisp-13142dc7f38e6b148efadc97edffca8664b9cde7.zip |
refactor lisp runtime to use vec_t* instead of ivec_t*
bit nicer to look at, should have about the same painful performance
hit anyway.
Diffstat (limited to 'alisp.h')
-rw-r--r-- | alisp.h | 14 |
1 files changed, 5 insertions, 9 deletions
@@ -53,7 +53,9 @@ typedef struct Vector void *data; } vec_t; -#define VEC_MULT 2 +#define VEC_MULT 2 +#define VEC_DEFAULT_CAPACITY 8 + void vec_free(vec_t *); void vec_ensure_free(vec_t *, u64); void vec_append(vec_t *, void *, u64); @@ -103,12 +105,6 @@ typedef struct lisp_t *car, *cdr; } cons_t; -typedef struct -{ - // 2 levels of indirection... disgusting - void *data; -} lvec_t; - /// System context - essentially something to help with system management typedef struct { @@ -129,7 +125,7 @@ lisp_t *cons(sys_t *, lisp_t *, lisp_t *); i64 as_int(lisp_t *); sv_t *as_sym(lisp_t *); cons_t *as_cons(lisp_t *); -void *as_vec(lisp_t *); +vec_t *as_vec(lisp_t *); #define CAR(L) (as_cons(L)->car) #define CDR(L) (as_cons(L)->cdr) @@ -174,6 +170,6 @@ tag_t get_tag(lisp_t *); lisp_t *tag_int(i64); lisp_t *tag_sym(sv_t *); lisp_t *tag_cons(cons_t *); -lisp_t *tag_vec(lvec_t *); +lisp_t *tag_vec(vec_t *); #endif |