summaryrefslogtreecommitdiff
path: root/src/std/mem.h
diff options
context:
space:
mode:
authorOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-25 13:31:17 +1100
committerOmniscient <17525998+omnisci3nce@users.noreply.github.com>2024-02-25 13:31:17 +1100
commitd919e8cb785c165ee700907b74672eb586c55d29 (patch)
tree7c43ccd269acaa1a2b384e951d8bb1ebd361743a /src/std/mem.h
parent4b9ab2ec5acf2ecf2e96c38733a835b964664171 (diff)
add an arena reset to free everything
Diffstat (limited to 'src/std/mem.h')
-rw-r--r--src/std/mem.h6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/std/mem.h b/src/std/mem.h
index 75b6d2a..36d30bd 100644
--- a/src/std/mem.h
+++ b/src/std/mem.h
@@ -14,9 +14,11 @@
// Inspired by https://nullprogram.com/blog/2023/09/27/
typedef struct arena {
char* begin;
+ char* curr;
char* end;
} arena;
arena arena_create(void* backing_buffer, size_t capacity);
-void *arena_alloc(arena* a, size_t size);
-void *arena_alloc_align(arena* a, size_t size, size_t align);
+void* arena_alloc(arena* a, size_t size);
+void* arena_alloc_align(arena* a, size_t size, size_t align);
+void arena_free_all(arena* a); \ No newline at end of file