aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c20
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);