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/world.c | |
parent | 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff) | |
download | serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2 serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip |
Use ZixAllocator directly
Diffstat (limited to 'src/world.c')
-rw-r--r-- | src/world.c | 20 |
1 files changed, 8 insertions, 12 deletions
diff --git a/src/world.c b/src/world.c index b4fe4ebc..b160fc4e 100644 --- a/src/world.c +++ b/src/world.c @@ -4,13 +4,13 @@ #include "world.h" #include "log.h" -#include "memory.h" #include "namespaces.h" #include "node.h" #include "serd/node.h" #include "serd/status.h" #include "serd/world.h" +#include "zix/allocator.h" #include "zix/string_view.h" #include <assert.h> @@ -18,19 +18,15 @@ #include <string.h> SerdWorld* -serd_world_new(SerdAllocator* const allocator) +serd_world_new(ZixAllocator* const allocator) { - SerdAllocator* const actual = - allocator ? allocator : serd_default_allocator(); - - SerdWorld* const world = - (SerdWorld*)serd_acalloc(actual, 1, sizeof(SerdWorld)); + ZixAllocator* const actual = allocator ? allocator : zix_default_allocator(); + SerdWorld* const world = (SerdWorld*)zix_calloc(actual, 1, sizeof(SerdWorld)); SerdNodes* const nodes = serd_nodes_new(actual); - if (!world || !nodes) { serd_nodes_free(nodes); - serd_afree(actual, world); + zix_free(actual, world); return NULL; } @@ -57,7 +53,7 @@ serd_world_new(SerdAllocator* const allocator) !(world->xsd_decimal = serd_nodes_get(nodes, serd_a_uri(xsd_decimal))) || !(world->xsd_integer = serd_nodes_get(nodes, serd_a_uri(xsd_integer)))) { serd_nodes_free(nodes); - serd_afree(actual, world); + zix_free(actual, world); return NULL; } @@ -72,7 +68,7 @@ serd_world_free(SerdWorld* const world) { if (world) { serd_nodes_free(world->nodes); - serd_afree(world->allocator, world); + zix_free(world->allocator, world); } } @@ -109,7 +105,7 @@ serd_world_get_blank(SerdWorld* const world) #undef BLANK_CHARS } -SerdAllocator* +ZixAllocator* serd_world_allocator(const SerdWorld* const world) { assert(world); |