diff options
Diffstat (limited to 'src/stack.h')
-rw-r--r-- | src/stack.h | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/stack.h b/src/stack.h index 20bd561b..40e8065d 100644 --- a/src/stack.h +++ b/src/stack.h @@ -4,7 +4,7 @@ #ifndef SERD_SRC_STACK_H #define SERD_SRC_STACK_H -#include "system.h" +#include "memory.h" #include <assert.h> #include <stdbool.h> @@ -19,21 +19,21 @@ typedef struct { } SerdStack; static inline SerdStack -serd_stack_new(size_t size, size_t align) +serd_stack_new(SerdAllocator* const allocator, size_t size, size_t align) { const size_t aligned_size = (size + (align - 1)) / align * align; SerdStack stack; - stack.buf = (char*)serd_calloc_aligned(align, aligned_size); + stack.buf = (char*)serd_aaligned_calloc(allocator, align, aligned_size); stack.buf_size = size; stack.size = align; // 0 is reserved for null return stack; } static inline void -serd_stack_free(SerdStack* stack) +serd_stack_free(SerdAllocator* const allocator, SerdStack* stack) { - serd_free_aligned(stack->buf); + serd_aaligned_free(allocator, stack->buf); stack->buf = NULL; stack->buf_size = 0; stack->size = 0; |