diff options
author | David Robillard <d@drobilla.net> | 2022-12-19 17:55:02 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | 0f9816d67bc67a396607291f845ca2a33c2285a7 (patch) | |
tree | b31fd1b344305dc984a2109084fa183573a0ae43 /src/statement.c | |
parent | 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff) | |
download | serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2 serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip |
Use ZixAllocator directly
Diffstat (limited to 'src/statement.c')
-rw-r--r-- | src/statement.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/src/statement.c b/src/statement.c index 5ea14910..45c10459 100644 --- a/src/statement.c +++ b/src/statement.c @@ -4,11 +4,10 @@ #include "statement.h" #include "caret.h" -#include "memory.h" #include "node.h" -#include "serd/memory.h" #include "serd/statement.h" +#include "zix/allocator.h" #include <assert.h> #include <stdbool.h> @@ -36,7 +35,7 @@ serd_statement_is_valid(const SerdNode* const subject, } SerdStatement* -serd_statement_new(SerdAllocator* const allocator, +serd_statement_new(ZixAllocator* const allocator, const SerdNode* const s, const SerdNode* const p, const SerdNode* const o, @@ -52,7 +51,7 @@ serd_statement_new(SerdAllocator* const allocator, } SerdStatement* statement = - (SerdStatement*)serd_amalloc(allocator, sizeof(SerdStatement)); + (SerdStatement*)zix_malloc(allocator, sizeof(SerdStatement)); if (statement) { statement->nodes[0] = s; @@ -63,7 +62,7 @@ serd_statement_new(SerdAllocator* const allocator, if (caret) { if (!(statement->caret = serd_caret_copy(allocator, caret))) { - serd_afree(allocator, statement); + zix_free(allocator, statement); return NULL; } } @@ -73,7 +72,7 @@ serd_statement_new(SerdAllocator* const allocator, } SerdStatement* -serd_statement_copy(SerdAllocator* const allocator, +serd_statement_copy(ZixAllocator* const allocator, const SerdStatement* const statement) { if (!statement) { @@ -81,15 +80,15 @@ serd_statement_copy(SerdAllocator* const allocator, } SerdStatement* copy = - (SerdStatement*)serd_amalloc(allocator, sizeof(SerdStatement)); + (SerdStatement*)zix_malloc(allocator, sizeof(SerdStatement)); if (copy) { memcpy(copy, statement, sizeof(SerdStatement)); if (statement->caret) { if (!(copy->caret = - (SerdCaret*)serd_amalloc(allocator, sizeof(SerdCaret)))) { - serd_afree(allocator, copy); + (SerdCaret*)zix_malloc(allocator, sizeof(SerdCaret)))) { + zix_free(allocator, copy); return NULL; } @@ -101,12 +100,12 @@ serd_statement_copy(SerdAllocator* const allocator, } void -serd_statement_free(SerdAllocator* const allocator, +serd_statement_free(ZixAllocator* const allocator, SerdStatement* const statement) { if (statement) { - serd_afree(allocator, statement->caret); - serd_afree(allocator, statement); + zix_free(allocator, statement->caret); + zix_free(allocator, statement); } } |