aboutsummaryrefslogtreecommitdiff
path: root/src/scoped_allocator.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/scoped_allocator.c')
-rw-r--r--src/scoped_allocator.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/scoped_allocator.c b/src/scoped_allocator.c
index 7e2cb0d..4d40740 100644
--- a/src/scoped_allocator.c
+++ b/src/scoped_allocator.c
@@ -28,6 +28,13 @@ int scoped_allocator_init(ScopedAllocator *self) {
return buffer_init(&self->buffers, NULL);
}
+static void buffer_deinit(Buffer *self) {
+ am_free(self->data);
+ self->data = NULL;
+ self->size = 0;
+ self->capacity = 0;
+}
+
void scoped_allocator_deinit(ScopedAllocator *self) {
Buffer *buffer;
Buffer *buffer_end;