summaryrefslogtreecommitdiffstats
path: root/src/alloc.h
diff options
context:
space:
mode:
authorTavian Barnes <tavianator@tavianator.com>2023-08-31 10:16:15 -0400
committerTavian Barnes <tavianator@tavianator.com>2023-08-31 10:16:15 -0400
commit5f736eada55f84c7499103faf7c181b80eb7092f (patch)
treeeb7897dfd62a726e5e4325ffd7833448f9350bc4 /src/alloc.h
parentf34baf1a2f42259a4873f6d9733078003184d4e4 (diff)
downloadbfs-5f736eada55f84c7499103faf7c181b80eb7092f.tar.xz
alloc: New [v]arena_clear() functions
Diffstat (limited to 'src/alloc.h')
-rw-r--r--src/alloc.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/alloc.h b/src/alloc.h
index c2ea09b..b5dfa68 100644
--- a/src/alloc.h
+++ b/src/alloc.h
@@ -186,6 +186,11 @@ void *arena_alloc(struct arena *arena);
void arena_free(struct arena *arena, void *ptr);
/**
+ * Free all allocations from an arena.
+ */
+void arena_clear(struct arena *arena);
+
+/**
* Destroy an arena, freeing all allocations.
*/
void arena_destroy(struct arena *arena);
@@ -278,6 +283,11 @@ void *varena_realloc(struct varena *varena, void *ptr, size_t old_count, size_t
void varena_free(struct varena *varena, void *ptr, size_t count);
/**
+ * Free all allocations from a varena.
+ */
+void varena_clear(struct varena *varena);
+
+/**
* Destroy a varena, freeing all allocations.
*/
void varena_destroy(struct varena *varena);