Fix __dynamic_array_reserve to allow for zero sized elements

This commit is contained in:
gingerBill
2020-02-26 12:55:56 +00:00
committed by GitHub
parent 15f5c85379
commit 4d7270cec9
+1 -3
View File
@@ -1141,11 +1141,9 @@ __dynamic_array_reserve :: proc(array_: rawptr, elem_size, elem_align: int, cap:
allocator := array.allocator;
new_data := allocator.procedure(allocator.data, .Resize, new_size, elem_align, array.data, old_size, 0, loc);
if new_data == nil do return false;
array.data = new_data;
array.cap = cap;
return true;
return new_data != nil || elem_size == 0;
}
__dynamic_array_resize :: proc(array_: rawptr, elem_size, elem_align: int, len: int, loc := #caller_location) -> bool {