Checkpoint file split.

This commit is contained in:
2025-11-28 02:27:19 -08:00
parent 4db6077738
commit a0d760c7d2
11 changed files with 960 additions and 775 deletions

22
abuf.c
View File

@@ -3,10 +3,11 @@
#include <string.h>
#include "abuf.h"
#include "core.h"
void
abuf_init(abuf *buf)
ab_init(abuf *buf)
{
assert(buf != NULL);
@@ -15,6 +16,25 @@ abuf_init(abuf *buf)
}
void
ab_init_cap(abuf *buf, const size_t cap)
{
buf->b = calloc(cap, 1);
buf->size = 0;
buf->cap = cap;
}
void
ab_resize(abuf *buf, size_t cap)
{
cap = cap_growth(buf->cap, cap);
buf->b = realloc(buf->b, cap);
assert(buf->b != NULL);
buf->cap = cap;
}
void
ab_appendch(abuf *buf, char c)
{