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.
This commit is contained in:
2025-08-20 22:33:40 +01:00
parent 2369185b26
commit 6e2db6825d
3 changed files with 70 additions and 1 deletions

12
alisp.h
View File

@@ -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