From 0e739f34801ff6810064a8fac570f6be2b61ae70 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 13 Aug 2021 20:31:57 -0400 Subject: Simplify output stream API This makes the paging mechanism an internal detail once again. While it's conceptually elegant to simply have a single write interface and have the block dumper just be another implementation of that, unfortunately it is not practical. The inlining of serd_block_dumper_write() is a significant performance boost, because it avoids a non-inlinable function call of overhead per character. Compared to the SerdByteSink approach, this removes the burden and overhead of needing to dynamically allocate the structure itself. --- test/test_terse_write.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/test_terse_write.c') diff --git a/test/test_terse_write.c b/test/test_terse_write.c index aeb264ea..d9ce4d1b 100644 --- a/test/test_terse_write.c +++ b/test/test_terse_write.c @@ -64,9 +64,9 @@ test(void) serd_env_set_prefix(env, SERD_STRING("rdf"), SERD_STRING(NS_RDF)); - SerdByteSink* const byte_sink = serd_byte_sink_new_buffer(&buffer); - SerdWriter* const writer = - serd_writer_new(world, SERD_TURTLE, 0, env, byte_sink); + SerdOutputStream output = serd_open_output_buffer(&buffer); + SerdWriter* const writer = + serd_writer_new(world, SERD_TURTLE, 0, env, &output, 1); const SerdSink* const sink = serd_writer_sink(writer); @@ -99,7 +99,7 @@ test(void) check_output(writer, &buffer, "[]\n\trdf:value ( \"s1\" \"s2\" ) .\n"); serd_writer_free(writer); - serd_byte_sink_free(byte_sink); + serd_close_output(&output); serd_nodes_free(nodes); serd_env_free(env); serd_world_free(world); -- cgit v1.2.1