From bd5d095de4a3a3de574f6004751718ee944417cc Mon Sep 17 00:00:00 2001 From: Ginger Bill Date: Sun, 23 Oct 2016 14:46:52 +0100 Subject: Separate ssa_struct_gep and ssa_array_gep procedures --- src/common.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/common.cpp') diff --git a/src/common.cpp b/src/common.cpp index 4399e3962..465459ce3 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -1,6 +1,10 @@ #define GB_IMPLEMENTATION #include "gb/gb.h" +gbAllocator heap_allocator(void) { + return gb_heap_allocator(); +} + #include "string.cpp" #include "array.cpp" @@ -14,7 +18,7 @@ String get_module_dir() { } Array path_buf; - array_init(&path_buf, gb_heap_allocator(), 300); + array_init(&path_buf, heap_allocator(), 300); defer (array_free(&path_buf)); array_resize(&path_buf, 300); @@ -36,7 +40,7 @@ String get_module_dir() { wchar_t *text = gb_alloc_array(string_buffer_allocator, wchar_t, len+1); GetModuleFileNameW(NULL, text, len); - String path = string16_to_string(gb_heap_allocator(), make_string16(text, len)); + String path = string16_to_string(heap_allocator(), make_string16(text, len)); for (isize i = path.len-1; i >= 0; i--) { u8 c = path.text[i]; if (c == '/' || c == '\\') { -- cgit v1.2.3