Fix delayed assert collection

This commit is contained in:
gingerBill
2018-05-27 13:49:55 +01:00
parent 307977d4cf
commit 86cf9383ea
5 changed files with 16 additions and 29 deletions

View File

@@ -54,7 +54,10 @@ gb_inline void array_init(Array<T> *array, gbAllocator const &a, isize count) {
template <typename T>
gb_inline void array_init(Array<T> *array, gbAllocator const &a, isize count, isize capacity) {
array->allocator = a;
array->data = gb_alloc_array(a, T, capacity);
array->data = nullptr;
if (capacity > 0) {
array->data = gb_alloc_array(a, T, capacity);
}
array->count = count;
array->capacity = capacity;
}