aboutsummaryrefslogtreecommitdiffstats
path: root/src/filter.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/filter.c')
-rw-r--r--src/filter.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/src/filter.c b/src/filter.c
index 581a7b72..dc6ef152 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -3,13 +3,12 @@
#include "serd/filter.h"
+#include "sink.h"
+
#include "serd/event.h"
-#include "serd/memory.h"
#include "serd/statement.h"
#include "serd/status.h"
-
-#include "memory.h"
-#include "sink.h"
+#include "zix/allocator.h"
#include <assert.h>
#include <stdbool.h>
@@ -29,13 +28,13 @@ free_data(void* const handle)
{
if (handle) {
SerdFilterData* const data = (SerdFilterData*)handle;
- SerdAllocator* const allocator = data->target->allocator;
+ ZixAllocator* const allocator = data->target->allocator;
serd_node_free(allocator, data->subject);
serd_node_free(allocator, data->predicate);
serd_node_free(allocator, data->object);
serd_node_free(allocator, data->graph);
- serd_afree(allocator, data);
+ zix_free(allocator, data);
}
}
@@ -77,9 +76,9 @@ serd_filter_new(const SerdWorld* const world,
assert(world);
assert(target);
- SerdAllocator* const allocator = serd_world_allocator(world);
+ ZixAllocator* const alloc = serd_world_allocator(world);
SerdFilterData* const data =
- (SerdFilterData*)serd_wcalloc(world, 1, sizeof(SerdFilterData));
+ (SerdFilterData*)zix_calloc(alloc, 1, sizeof(SerdFilterData));
if (!data) {
return NULL;
@@ -89,35 +88,35 @@ serd_filter_new(const SerdWorld* const world,
data->inclusive = inclusive;
if (subject && serd_node_type(subject) != SERD_VARIABLE) {
- if (!(data->subject = serd_node_copy(allocator, subject))) {
+ if (!(data->subject = serd_node_copy(alloc, subject))) {
free_data(data);
return NULL;
}
}
if (predicate && serd_node_type(predicate) != SERD_VARIABLE) {
- if (!(data->predicate = serd_node_copy(allocator, predicate))) {
+ if (!(data->predicate = serd_node_copy(alloc, predicate))) {
free_data(data);
return NULL;
}
}
if (object && serd_node_type(object) != SERD_VARIABLE) {
- if (!(data->object = serd_node_copy(allocator, object))) {
+ if (!(data->object = serd_node_copy(alloc, object))) {
free_data(data);
return NULL;
}
}
if (graph && serd_node_type(graph) != SERD_VARIABLE) {
- if (!(data->graph = serd_node_copy(allocator, graph))) {
+ if (!(data->graph = serd_node_copy(alloc, graph))) {
free_data(data);
return NULL;
}
}
SerdSink* const sink =
- serd_sink_new(allocator, data, serd_filter_on_event, free_data);
+ serd_sink_new(alloc, data, serd_filter_on_event, free_data);
if (!sink) {
free_data(data);