#complete switch; Removal of dyncall

This commit is contained in:
gingerBill
2018-02-17 11:54:08 +00:00
parent 6a85546b76
commit c4d2d287fc
52 changed files with 330 additions and 2328 deletions

View File

@@ -30,8 +30,8 @@ struct HashKey {
// u128 key;
u64 key;
union {
String string; // if String, s.len > 0
void * ptr;
String string; // if String, s.len > 0
void * ptr;
PtrAndId ptr_and_id;
};
};
@@ -65,6 +65,16 @@ gb_inline HashKey hash_ptr_and_id(void *ptr, u32 id) {
h.ptr_and_id.id = id;
return h;
}
gb_inline HashKey hash_integer(u64 u) {
HashKey h = {HashKey_Default};
h.key = u;
return h;
}
gb_inline HashKey hash_f64(f64 f) {
HashKey h = {HashKey_Default};
h.key = *cast(u64 *)&f;
return h;
}
bool hash_key_equal(HashKey a, HashKey b) {
if (a.key == b.key) {