diff options
| author | Ginger Bill <bill@gingerbill.org> | 2017-01-28 20:16:18 +0000 |
|---|---|---|
| committer | Ginger Bill <bill@gingerbill.org> | 2017-01-28 20:16:18 +0000 |
| commit | e86c990b75bb30f0116430453b42a59317e3fead (patch) | |
| tree | 2645005099bd2cf744299d6a3538408ed5728d39 /src/gb/gb.h | |
| parent | 31aacd5bf435224c7d8f9b19359175d3e6d25660 (diff) | |
Overloaded `free`; 3 dotted ellipsisv0.0.6a
Diffstat (limited to 'src/gb/gb.h')
| -rw-r--r-- | src/gb/gb.h | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/gb/gb.h b/src/gb/gb.h index 4c7498aa7..304f782b2 100644 --- a/src/gb/gb.h +++ b/src/gb/gb.h @@ -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: { |