aboutsummaryrefslogtreecommitdiffstats
path: root/src/byte_sink.h
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2020-11-12 20:18:47 +0100
committerDavid Robillard <d@drobilla.net>2020-11-13 01:15:05 +0100
commitfebc0828f271aa06681081217ee3ab2649dbf13a (patch)
treee4123cd6fdc68ba34170e897104824dabb01000c /src/byte_sink.h
parentbeed84b63136603600528c0f48bcf93f6cb51de4 (diff)
downloadserd-febc0828f271aa06681081217ee3ab2649dbf13a.tar.gz
serd-febc0828f271aa06681081217ee3ab2649dbf13a.tar.bz2
serd-febc0828f271aa06681081217ee3ab2649dbf13a.zip
Use aligned allocation via C11 or Windows API where possible
Diffstat (limited to 'src/byte_sink.h')
-rw-r--r--src/byte_sink.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/byte_sink.h b/src/byte_sink.h
index f39bc2ba..876add2b 100644
--- a/src/byte_sink.h
+++ b/src/byte_sink.h
@@ -42,7 +42,7 @@ serd_byte_sink_new(SerdSink sink, void* stream, size_t block_size)
bsink.size = 0;
bsink.block_size = block_size;
bsink.buf = ((block_size > 1)
- ? (uint8_t*)serd_bufalloc(block_size)
+ ? (uint8_t*)serd_allocate_buffer(block_size)
: NULL);
return bsink;
}
@@ -60,7 +60,7 @@ static inline void
serd_byte_sink_free(SerdByteSink* bsink)
{
serd_byte_sink_flush(bsink);
- free(bsink->buf);
+ serd_free_aligned(bsink->buf);
bsink->buf = NULL;
}