Split alisp.h into several header files, in /include folder.

This commit is contained in:
2026-02-04 19:26:56 +00:00
parent 27108aa811
commit 7f8412fe5a
19 changed files with 539 additions and 311 deletions

View File

@@ -8,7 +8,7 @@
#include <malloc.h>
#include <string.h>
#include "../alisp.h"
#include <alisp/vec.h>
void vec_init(vec_t *vec, u64 size)
{
@@ -47,6 +47,14 @@ void vec_ensure_free(vec_t *vec, u64 size)
{
if (!vec)
return;
if (vec->capacity == 0)
{
// We need to initialise this ourselves.
vec->capacity = VEC_INLINE_CAPACITY;
vec->size = 0;
memset(vec->inlined, 0, sizeof(vec->inlined));
}
if (vec->capacity - vec->size < size)
{
vec->capacity = MAX(vec->capacity * VEC_MULT, vec->size + size);