aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/buffer.h1
-rw-r--r--src/buffer.c7
-rw-r--r--src/scoped_allocator.c7
3 files changed, 7 insertions, 8 deletions
diff --git a/include/buffer.h b/include/buffer.h
index e0c4046..84e0cfa 100644
--- a/include/buffer.h
+++ b/include/buffer.h
@@ -15,7 +15,6 @@ typedef struct {
} Buffer;
CHECK_RESULT int buffer_init(Buffer *self, struct ScopedAllocator *allocator);
-void buffer_deinit(Buffer *self);
CHECK_RESULT int buffer_append(Buffer *self, void *data, usize size);
void* buffer_get(Buffer *self, usize index, usize type_size);
diff --git a/src/buffer.c b/src/buffer.c
index 349c186..d5e6d97 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -14,13 +14,6 @@ int buffer_init(Buffer *self, ScopedAllocator *allocator) {
return 0;
}
-void buffer_deinit(Buffer *self) {
- am_free(self->data);
- self->data = NULL;
- self->size = 0;
- self->capacity = 0;
-}
-
static CHECK_RESULT int buffer_ensure_capacity(Buffer *self, usize new_capacity) {
usize capacity;
void *new_mem;
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;