Fix Type_Info bug overwriting type_info data.

This commit is contained in:
Ginger Bill
2016-10-23 22:50:15 +01:00
parent b454371f3b
commit a5c1e83ce4
8 changed files with 205 additions and 110 deletions

View File

@@ -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;
}