diff options
| author | gingerBill <bill@gingerbill.org> | 2021-07-10 19:57:54 +0100 |
|---|---|---|
| committer | gingerBill <bill@gingerbill.org> | 2021-07-10 19:57:54 +0100 |
| commit | 0a61d4bf2b2d6e8c8d0c92410f6dcfd2b6046f86 (patch) | |
| tree | 35fb694e1128eb3afd4838f5dbee8b9f790cef37 /src/ptr_set.cpp | |
| parent | 332461c0d2703ae6dad4e0fb6812b57ffa92815e (diff) | |
Use `next_pow2_isize`
Diffstat (limited to 'src/ptr_set.cpp')
| -rw-r--r-- | src/ptr_set.cpp | 17 |
1 files changed, 0 insertions, 17 deletions
diff --git a/src/ptr_set.cpp b/src/ptr_set.cpp index 5432fa094..f12deede8 100644 --- a/src/ptr_set.cpp +++ b/src/ptr_set.cpp @@ -32,23 +32,6 @@ template <typename T> void ptr_set_grow (PtrSet<T> *s); template <typename T> void ptr_set_rehash (PtrSet<T> *s, isize new_count); -isize next_pow2_isize(isize n) { - if (n <= 0) { - return 0; - } - n--; - n |= n >> 1; - n |= n >> 2; - n |= n >> 4; - n |= n >> 8; - n |= n >> 16; - if (gb_size_of(isize) == 8) { - n |= n >> 32; - } - n++; - return n; -} - template <typename T> void ptr_set_init(PtrSet<T> *s, gbAllocator a, isize capacity) { capacity = next_pow2_isize(gb_max(16, capacity)); |