diff options
author | David Robillard <d@drobilla.net> | 2023-12-02 01:20:48 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:07 -0500 |
commit | 930f28478ca2573b7f7baf29a57a03cfa95a841f (patch) | |
tree | ccd9fca0955c8c92e6f3d3cacd032024c1c3d4b7 /test/test_overflow.c | |
parent | 06bc73c6fdf986eb5d13943b497992a947661bb1 (diff) | |
download | serd-930f28478ca2573b7f7baf29a57a03cfa95a841f.tar.gz serd-930f28478ca2573b7f7baf29a57a03cfa95a841f.tar.bz2 serd-930f28478ca2573b7f7baf29a57a03cfa95a841f.zip |
Add a set of limits to the world
The idea here is to remove the burden of passing things around like stack
sizes (where most users don't care and will be happy with a reasonably large
default) and keeping the call sites to things like serd_reader_new() clean.
The cost is a bit more state, so it's both more powerful and more potentially
flaky, since changing the limits has action at a distance that isn't clear from
the call site. I think it's worth it for the cleaner API in the common case,
and the much better forward compatibility.
Diffstat (limited to 'test/test_overflow.c')
-rw-r--r-- | test/test_overflow.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/test/test_overflow.c b/test/test_overflow.c index 62154958..ac47d239 100644 --- a/test/test_overflow.c +++ b/test/test_overflow.c @@ -17,8 +17,12 @@ test_size(SerdWorld* const world, const SerdSyntax syntax, const size_t stack_size) { + SerdLimits limits = serd_world_limits(world); + limits.reader_stack_size = stack_size; + serd_world_set_limits(world, limits); + SerdSink* sink = serd_sink_new(NULL, NULL, NULL); - SerdReader* const reader = serd_reader_new(world, syntax, sink, stack_size); + SerdReader* const reader = serd_reader_new(world, syntax, sink); if (!reader) { return SERD_BAD_STACK; } |