diff options
Diffstat (limited to 'source')
-rw-r--r-- | source/kit/allocator.c | 4 | ||||
-rw-r--r-- | source/kit/xml.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/source/kit/allocator.c b/source/kit/allocator.c index 920da5a..e1446ac 100644 --- a/source/kit/allocator.c +++ b/source/kit/allocator.c @@ -173,7 +173,9 @@ void *kit_alloc_dispatch(kit_allocator_t *alloc, i32 request, pointer); case KIT_ALLOC_TYPE_BUFFER: - return kit_allocate_from_buffer_(alloc, request, size, + return kit_allocate_from_buffer_(alloc, request, + // alignment + ((size + 7) / 8) * 8, previous_size, pointer); default:; diff --git a/source/kit/xml.c b/source/kit/xml.c index 1c8e9f6..a9d18e3 100644 --- a/source/kit/xml.c +++ b/source/kit/xml.c @@ -69,6 +69,7 @@ static ib_t kit_xml_parse_text_(ib_t begin) { i64 n = text.data.size; DA_RESIZE(text.data, n + next_text.data.size); + assert(text.data.size == n + next_text.data.size); if (text.data.size != n + next_text.data.size) next_text.status = KIT_ERROR_BAD_ALLOC; else @@ -200,6 +201,7 @@ static kit_xml_intermediate_t kit_xml_parse_buf_( i64 n = tag.properties.size; DA_RESIZE(tag.properties, n + 1); + assert(tag.properties.size == n + 1); if (tag.properties.size != n + 1) { last.status = KIT_ERROR_BAD_ALLOC; DA_DESTROY(tag.properties); @@ -277,6 +279,7 @@ static kit_xml_intermediate_t kit_xml_parse_buf_( i64 n = res.tags.size; DA_RESIZE(res.tags, n + 1); + assert(res.tags.size == n + 1); if (res.tags.size != n + 1) { last.status = KIT_ERROR_BAD_ALLOC; xml_destroy(&tag); |