aboutsummaryrefslogtreecommitdiffstats
path: root/test/test_overflow.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2023-09-10 15:06:42 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:08 -0500
commit248a874d7425749d29cf900a1c3783c624ea8d8c (patch)
treeaed59f5a484a815cd254506866e98a947858904d /test/test_overflow.c
parent0bd10132c6707353dba80bd89cf0102ee7ca4e34 (diff)
downloadserd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.gz
serd-248a874d7425749d29cf900a1c3783c624ea8d8c.tar.bz2
serd-248a874d7425749d29cf900a1c3783c624ea8d8c.zip
Add support for custom allocators
This makes it explicit in the API where memory is allocated, and allows the user to provide a custom allocator to avoid the use of the default system allocator for whatever reason.
Diffstat (limited to 'test/test_overflow.c')
-rw-r--r--test/test_overflow.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/test_overflow.c b/test/test_overflow.c
index 6272e807..7b1693a8 100644
--- a/test/test_overflow.c
+++ b/test/test_overflow.c
@@ -22,14 +22,14 @@ test_size(SerdWorld* const world,
limits.reader_stack_size = stack_size;
serd_world_set_limits(world, limits);
- SerdSink* sink = serd_sink_new(NULL, NULL, NULL);
- SerdEnv* const env = serd_env_new(serd_empty_string());
+ SerdSink* sink = serd_sink_new(NULL, NULL, NULL, NULL);
+ SerdEnv* const env = serd_env_new(NULL, serd_empty_string());
SerdReader* const reader = serd_reader_new(world, syntax, flags, env, sink);
if (!reader) {
return SERD_BAD_STACK;
}
- SerdNode* string_name = serd_new_string(serd_string("string"));
+ SerdNode* string_name = serd_new_string(NULL, serd_string("string"));
const char* position = str;
SerdInputStream in = serd_open_input_string(&position);
serd_reader_start(reader, &in, string_name, 1);
@@ -37,7 +37,7 @@ test_size(SerdWorld* const world,
const SerdStatus st = serd_reader_read_document(reader);
serd_close_input(&in);
- serd_node_free(string_name);
+ serd_node_free(NULL, string_name);
serd_reader_free(reader);
serd_env_free(env);
serd_sink_free(sink);
@@ -76,7 +76,7 @@ test_ntriples_overflow(void)
NULL,
};
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
for (const char* const* t = test_strings; *t; ++t) {
test_all_sizes(world, *t, SERD_NTRIPLES, 0U);
@@ -202,7 +202,7 @@ test_turtle_overflow(void)
NULL,
};
- SerdWorld* const world = serd_world_new();
+ SerdWorld* const world = serd_world_new(NULL);
for (const char* const* t = test_strings; *t; ++t) {
test_all_sizes(world, *t, SERD_TURTLE, SERD_READ_VARIABLES);