aboutsummaryrefslogtreecommitdiff
path: root/src/common.cpp
diff options
context:
space:
mode:
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;
}