about summary refs log tree commit diff stats
path: root/inc
diff options
context:
space:
mode:
Diffstat (limited to 'inc')
-rw-r--r--inc/arena.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/inc/arena.h b/inc/arena.h
new file mode 100644
index 0000000..dda105b
--- /dev/null
+++ b/inc/arena.h
@@ -0,0 +1,24 @@
+/*

+ * arena.h

+ * arena allocator i wrote during a meeting in 30 mins

+ * imogen sorindeia thoms 2025

+ * */

+

+#ifndef MOGI_ARENA_H

+#define MOGI_ARENA_H

+

+#include <stdlib.h>

+#include <stdint.h>

+

+struct _mogi_arena_s {

+	char *buffer;

+	size_t posn;

+	size_t capacity;

+};

+typedef struct _mogi_arena_s mogi_arena_t;

+

+mogi_arena_t mogi_arena_init(size_t size);

+void mogi_arena_dispose(mogi_arena_t *a);

+uintptr_t mogi_arena_allocate(mogi_arena_t *a, size_t size);

+

+#endif /* MOGI_ARENA_H */