diff options
author | David Robillard <d@drobilla.net> | 2022-12-19 17:55:02 -0500 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2023-12-02 18:49:08 -0500 |
commit | 0f9816d67bc67a396607291f845ca2a33c2285a7 (patch) | |
tree | b31fd1b344305dc984a2109084fa183573a0ae43 /src/byte_source.c | |
parent | 258ea2ff59bbd2127ea446cf4b9676ad3d7fe53d (diff) | |
download | serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.gz serd-0f9816d67bc67a396607291f845ca2a33c2285a7.tar.bz2 serd-0f9816d67bc67a396607291f845ca2a33c2285a7.zip |
Use ZixAllocator directly
Diffstat (limited to 'src/byte_source.c')
-rw-r--r-- | src/byte_source.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/byte_source.c b/src/byte_source.c index 249c0dde..6ec2084a 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -3,10 +3,10 @@ #include "byte_source.h" -#include "memory.h" #include "system.h" #include "serd/node.h" +#include "zix/allocator.h" #include <assert.h> #include <stdbool.h> @@ -39,11 +39,11 @@ serd_byte_source_page(SerdByteSource* const source) } static void -serd_byte_source_init_buffer(SerdAllocator* const allocator, +serd_byte_source_init_buffer(ZixAllocator* const allocator, SerdByteSource* const source) { if (source->block_size > 1) { - source->block = (uint8_t*)serd_aaligned_alloc( + source->block = (uint8_t*)zix_aligned_alloc( allocator, SERD_PAGE_SIZE, source->block_size); if ((source->read_buf = source->block)) { @@ -55,7 +55,7 @@ serd_byte_source_init_buffer(SerdAllocator* const allocator, } SerdByteSource* -serd_byte_source_new_input(SerdAllocator* const allocator, +serd_byte_source_new_input(ZixAllocator* const allocator, SerdInputStream* const input, const SerdNode* const name, const size_t block_size) @@ -73,7 +73,7 @@ serd_byte_source_new_input(SerdAllocator* const allocator, } SerdByteSource* source = - (SerdByteSource*)serd_acalloc(allocator, 1, sizeof(SerdByteSource)); + (SerdByteSource*)zix_calloc(allocator, 1, sizeof(SerdByteSource)); if (!source) { serd_node_free(allocator, source_name); @@ -91,7 +91,7 @@ serd_byte_source_new_input(SerdAllocator* const allocator, serd_byte_source_init_buffer(allocator, source); if (block_size > 1 && !source->block) { serd_node_free(allocator, source_name); - serd_afree(allocator, source); + zix_free(allocator, source); return NULL; } @@ -99,16 +99,16 @@ serd_byte_source_new_input(SerdAllocator* const allocator, } void -serd_byte_source_free(SerdAllocator* const allocator, +serd_byte_source_free(ZixAllocator* const allocator, SerdByteSource* const source) { if (source) { if (source->block_size > 1) { - serd_aaligned_free(allocator, source->block); + zix_aligned_free(allocator, source->block); } serd_node_free(allocator, source->name); - serd_afree(allocator, source); + zix_free(allocator, source); } } |