aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
authorGinger Bill <bill@gingerbill.org>2016-10-23 22:50:15 +0100
committerGinger Bill <bill@gingerbill.org>2016-10-23 22:50:15 +0100
commita5c1e83ce401eb78ae8e5b7b6a36ec812b3dfbf0 (patch)
tree1ecdda0750d011f16b962af73aea87f6e6cd18da /src/common.cpp
parentb454371f3b16d8c75671362ee673ccc72b722276 (diff)
Fix Type_Info bug overwriting type_info data.
Diffstat (limited to 'src/common.cpp')
-rw-r--r--src/common.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/common.cpp b/src/common.cpp
index 465459ce3..44ee869cb 100644
--- a/src/common.cpp
+++ b/src/common.cpp
@@ -5,13 +5,13 @@ gbAllocator heap_allocator(void) {
return gb_heap_allocator();
}
-
#include "string.cpp"
#include "array.cpp"
gb_global String global_module_path = {};
gb_global b32 global_module_path_set = false;
+
String get_module_dir() {
if (global_module_path_set) {
return global_module_path;
@@ -90,6 +90,7 @@ struct BlockTimer {
enum HashKeyKind {
HashKey_Default,
HashKey_String,
+ HashKey_Pointer,
};
struct HashKey {
@@ -97,6 +98,7 @@ struct HashKey {
u64 key;
union {
String string; // if String, s.len > 0
+ void * ptr;
};
};
@@ -118,6 +120,8 @@ gb_inline HashKey hash_string(String s) {
gb_inline HashKey hash_pointer(void *ptr) {
HashKey h = {};
h.key = cast(u64)cast(uintptr)ptr;
+ h.ptr = ptr;
+ h.kind = HashKey_Default;
return h;
}