diff options
author | David Robillard <d@drobilla.net> | 2020-11-12 20:18:47 +0100 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2020-11-13 01:15:05 +0100 |
commit | febc0828f271aa06681081217ee3ab2649dbf13a (patch) | |
tree | e4123cd6fdc68ba34170e897104824dabb01000c /src/byte_source.c | |
parent | beed84b63136603600528c0f48bcf93f6cb51de4 (diff) | |
download | serd-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_source.c')
-rw-r--r-- | src/byte_source.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/byte_source.c b/src/byte_source.c index d783959c..5c0404a7 100644 --- a/src/byte_source.c +++ b/src/byte_source.c @@ -22,7 +22,6 @@ #include <stdbool.h> #include <stdint.h> -#include <stdlib.h> #include <string.h> SerdStatus @@ -63,7 +62,7 @@ serd_byte_source_open_source(SerdByteSource* source, source->read_func = read_func; if (page_size > 1) { - source->file_buf = (uint8_t*)serd_bufalloc(page_size); + source->file_buf = (uint8_t*)serd_allocate_buffer(page_size); source->read_buf = source->file_buf; memset(source->file_buf, '\0', page_size); } else { @@ -102,7 +101,7 @@ SerdStatus serd_byte_source_close(SerdByteSource* source) { if (source->page_size > 1) { - free(source->file_buf); + serd_free_aligned(source->file_buf); } memset(source, '\0', sizeof(*source)); return SERD_SUCCESS; |