diff options
| author | gingerBill <bill+github@gingerbill.org> | 2016-08-10 10:00:57 +0100 |
|---|---|---|
| committer | gingerBill <bill+github@gingerbill.org> | 2016-08-10 10:00:57 +0100 |
| commit | c930841f834e43df28be41e8e3509773a523ed0f (patch) | |
| tree | f4de597e6028c64a7454ff116652f80c0d58ba34 /src/common.cpp | |
| parent | cff5e54ec6b8d9b95effcad1ca2dd8bb0988517b (diff) | |
f16/f128,u|i128, basic vector support.
Diffstat (limited to 'src/common.cpp')
| -rw-r--r-- | src/common.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/common.cpp b/src/common.cpp index d1905f1e8..2a0cd8371 100644 --- a/src/common.cpp +++ b/src/common.cpp @@ -20,6 +20,17 @@ gb_inline u64 hash_pointer(void *ptr) { return p; } +i64 next_pow2(i64 n) { + n--; + n |= n >> 1; + n |= n >> 2; + n |= n >> 4; + n |= n >> 8; + n |= n >> 16; + n |= n >> 32; + n++; + return n; +} #define gb_for_array(index_, array_) for (isize index_ = 0; index_ < gb_array_count(array_); index_++) |