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:
12
alisp.h
12
alisp.h
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user