diff options
| author | gingerBill <bill@gingerbill.org> | 2019-05-25 20:24:19 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2019-05-25 20:24:19 +0100 |
| commit | 458ec5922e69f105ca92d348e475693dfa252ad0 (patch) | |
| tree | 0c7db7614a6a3f9d05816e54adc03d82118f06c3 /src/common.cpp | |
| parent | f5fdd031f9b763a2b6a86f2fc536735fc8d7ed5d (diff) | |
odin query
Output .json file containing information about the program
Diffstat (limited to 'src/common.cpp')
| -rw-r--r-- | src/common.cpp | 14 |
1 files changed, 8 insertions, 6 deletions
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) |