Core: Add Ast_Label
This commit is contained in:
13
base.cpp
13
base.cpp
@@ -289,14 +289,13 @@ hash_string(String string) {
|
||||
return hash;
|
||||
}
|
||||
|
||||
CORE_Static U64
|
||||
force_inline U64
|
||||
hash_u64(U64 x) {
|
||||
x *= 0xff51afd7ed558ccd;
|
||||
x ^= x >> 32;
|
||||
return x;
|
||||
U64 result = hash_string({(U8 *)&x, sizeof(x)});
|
||||
return result;
|
||||
}
|
||||
|
||||
CORE_Static U64
|
||||
force_inline U64
|
||||
hash_ptr(const void *ptr) {
|
||||
return hash_u64((uintptr_t)ptr);
|
||||
}
|
||||
@@ -314,14 +313,14 @@ hash_mix(U64 x, U64 y) {
|
||||
return x;
|
||||
}
|
||||
|
||||
CORE_Static U64
|
||||
force_inline U64
|
||||
is_pow2(U64 x) {
|
||||
assert(x != 0);
|
||||
B32 result = (x & (x - 1llu)) == 0;
|
||||
return result;
|
||||
}
|
||||
|
||||
CORE_Static U64
|
||||
force_inline U64
|
||||
wrap_around_pow2(U64 x, U64 power_of_2) {
|
||||
assert(is_pow2(power_of_2));
|
||||
U64 r = (((x) & ((power_of_2)-1llu)));
|
||||
|
||||
Reference in New Issue
Block a user