-vet flag to do basic vetting of code

This commit is contained in:
gingerBill
2018-11-25 14:14:58 +00:00
parent 41ad896f3f
commit 444f4f446a
7 changed files with 152 additions and 27 deletions
+2 -2
View File
@@ -226,9 +226,9 @@ scratch_allocator_proc :: proc(allocator_data: rawptr, mode: Allocator_Mode,
case Allocator_Mode.Free:
last_ptr := rawptr(&scratch.data[scratch.prev_offset]);
if old_memory == last_ptr {
size := scratch.curr_offset - scratch.prev_offset;
full_size := scratch.curr_offset - scratch.prev_offset;
scratch.curr_offset = scratch.prev_offset;
zero(last_ptr, size);
zero(last_ptr, full_size);
return nil;
}
// NOTE(bill): It's scratch memory, don't worry about freeing