summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMitya Selivanov <automainint@guattari.tech>2023-09-22 21:23:29 +0200
committerMitya Selivanov <automainint@guattari.tech>2023-09-22 21:23:29 +0200
commited9f20507cb3199827feb203159656e233372e44 (patch)
tree81408dbc7a493f71650669b7138a3352fe571a27 /include
parent242b87209b778d033d1da828ae9ec47170c17f38 (diff)
downloadkit-ed9f20507cb3199827feb203159656e233372e44.zip
GL registry parsing
Diffstat (limited to 'include')
-rw-r--r--include/kit.inl.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/include/kit.inl.h b/include/kit.inl.h
index 9752919..7b7407d 100644
--- a/include/kit.inl.h
+++ b/include/kit.inl.h
@@ -2088,7 +2088,9 @@ void *kit_alloc_dispatch(kit_allocator_t *alloc, i32 request,
return kit_allocate_default_(request, size, previous_size,
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:;
}
@@ -4341,6 +4343,7 @@ static ib_t kit_xml_parse_text_(ib_t begin) {
if (next_text.status == KIT_OK && next_text.data.size > 0) {
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
@@ -4438,6 +4441,7 @@ static kit_xml_intermediate_t kit_xml_parse_buf_(
if (last.status == KIT_OK) {
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);
@@ -4499,6 +4503,7 @@ static kit_xml_intermediate_t kit_xml_parse_buf_(
if (last.status == KIT_OK) {
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);