diff options
author | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-08-20 22:33:40 +0100 |
---|---|---|
committer | Aryadev Chavali <aryadev@aryadevchavali.com> | 2025-08-20 22:33:40 +0100 |
commit | 6e2db6825d4ff4b57be3086f654a84cc9ff64bcf (patch) | |
tree | b9a7bb71ff55f7ef6d34ab90574ed86cd1f39b43 /alisp.h | |
parent | 2369185b269164c9fd3cc888dbde117192d08bff (diff) | |
download | alisp-6e2db6825d4ff4b57be3086f654a84cc9ff64bcf.tar.gz alisp-6e2db6825d4ff4b57be3086f654a84cc9ff64bcf.tar.bz2 alisp-6e2db6825d4ff4b57be3086f654a84cc9ff64bcf.zip |
Stable vector implementation
Stable vectors will be used in the lisp runtime to implement actual
vectors, instead of using the disgusting lvec trick. This way we at
least can get attributes about the vector through one pointer hop.
Diffstat (limited to 'alisp.h')
-rw-r--r-- | alisp.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -46,6 +46,18 @@ typedef struct sv_t sv_copy(sv_t); +/// Good ol' Dynamic Arrays +typedef struct Vector +{ + u64 size, capacity; + void *data; +} vec_t; + +#define VEC_MULT 2 +void vec_free(vec_t *); +void vec_ensure_free(vec_t *, u64); +void vec_append(vec_t *, void *, u64); +void vec_clone(vec_t *, vec_t *); /// Inlined Dynamic arrays typedef struct InlineVector |