Overloaded free; 3 dotted ellipsis

This commit is contained in:
Ginger Bill
2017-01-28 20:16:18 +00:00
parent 31aacd5bf4
commit e86c990b75
12 changed files with 111 additions and 48 deletions
+3 -7
View File
@@ -4819,14 +4819,10 @@ GB_ALLOCATOR_PROC(gb_heap_allocator_proc) {
#else
// TODO(bill): *nix version that's decent
case gbAllocation_Alloc: {
gbAllocationHeader *header;
isize total_size = size + alignment + gb_size_of(gbAllocationHeader);
ptr = malloc(total_size);
header = cast(gbAllocationHeader *)ptr;
ptr = gb_align_forward(header+1, alignment);
gb_allocation_header_fill(header, ptr, size);
if (flags & gbAllocatorFlag_ClearToZero)
ptr = aligned_alloc(alignment, size);
if (flags & gbAllocatorFlag_ClearToZero) {
gb_zero_size(ptr, size);
}
} break;
case gbAllocation_Free: {