aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-10-23 14:46:52 +0100
committerGinger Bill <bill@gingerbill.org>2016-10-23 14:46:52 +0100
commitbd5d095de4a3a3de574f6004751718ee944417cc (patch)
tree0eaceb775794fe21073c2b4159287ae08b99c3e3 /src/common.cpp
parentf60dc7b0a7f8bf8122df0fa3b4d12603a9775f87 (diff)
Separate ssa_struct_gep and ssa_array_gep procedures
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp8
1 files changed, 6 insertions, 2 deletions
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<wchar_t> 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 == '\\') {