Fix nil comparisons for soa slices and dynamic arrays

This commit is contained in:
gingerBill
2019-12-01 11:56:08 +00:00
parent 3fd5c3cd85
commit 7fbe0a6f23
4 changed files with 49 additions and 6 deletions
+4 -3
View File
@@ -164,9 +164,10 @@ heap_allocator_proc :: proc(allocator_data: rawptr, mode: mem.Allocator_Mode,
return aligned_heap_alloc(size, alignment);
case .Free:
assert(old_memory != nil);
ptr := recover_original_pointer(old_memory);
heap_free(ptr);
if old_memory != nil {
ptr := recover_original_pointer(old_memory);
heap_free(ptr);
}
return nil;
case .Free_All: