From 458ec5922e69f105ca92d348e475693dfa252ad0 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 25 May 2019 20:24:19 +0100 Subject: odin query Output .json file containing information about the program --- src/common.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'src/common.cpp') diff --git a/src/common.cpp b/src/common.cpp index ed1fd16e2..8085e895c 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -73,16 +73,18 @@ GB_ALLOCATOR_PROC(heap_allocator_proc) { ptr = _aligned_realloc(old_memory, size, alignment); break; #else - case gbAllocation_Alloc: + case gbAllocation_Alloc: { + isize aligned_size = align_formula_isize(size, alignment); // TODO(bill): Make sure this is aligned correctly - ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, align_formula_isize(size, alignment)); - break; + ptr = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, aligned_size); + } break; case gbAllocation_Free: HeapFree(GetProcessHeap(), 0, old_memory); break; - case gbAllocation_Resize: - ptr = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, old_memory, align_formula_isize(size, alignment)); - break; + case gbAllocation_Resize: { + isize aligned_size = align_formula_isize(size, alignment); + ptr = HeapReAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, old_memory, aligned_size); + } break; #endif #elif defined(GB_SYSTEM_LINUX) -- cgit v1.2.3