From 0a61d4bf2b2d6e8c8d0c92410f6dcfd2b6046f86 Mon Sep 17 00:00:00 2001 From: gingerBill Date: Sat, 10 Jul 2021 19:57:54 +0100 Subject: Use `next_pow2_isize` --- src/ptr_set.cpp | 17 ----------------- 1 file changed, 17 deletions(-) (limited to 'src/ptr_set.cpp') 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 void ptr_set_grow (PtrSet *s); template void ptr_set_rehash (PtrSet *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 void ptr_set_init(PtrSet *s, gbAllocator a, isize capacity) { capacity = next_pow2_isize(gb_max(16, capacity)); -- cgit v1.2.3