Modify various power 2 calculations to use new helper functions
David Rowley <drowley@postgresql.org>
Modify various power 2 calculations to use new helper functions First pass of modifying various places that obtain the next power of 2 of a number and make them use the new functions added in pg_bitutils.h instead. This also removes the _hash_log2() function. There are no longer any callers in core. Other users can swap their _hash_log2(n) call to make use of pg_ceil_log2_32(n). Author: David Fetter, with some minor adjustments by me Reviewed-by: John Naylor, Jesse Zhang Discussion: https://postgr.es/m/20200114173553.GE32763%40fetter.org
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/hash/hashpage.c | modified | +11 −13 |
| src/backend/access/hash/hashsort.c | modified | +2 −1 |
| src/backend/access/hash/hashutil.c | modified | +2 −17 |
| src/backend/utils/hash/dynahash.c | modified | +7 −7 |
| src/include/access/hash.h | modified | +0 −1 |
| src/include/lib/simplehash.h | modified | +4 −23 |
| src/include/port/pg_bitutils.h | modified | +6 −0 |
Discussion
- Use compiler intrinsics for bit ops in hash 26 messages · 2020-01-14 → 2020-04-08