pgsql: Modify various power 2 calculations to use new helper functions

From: David Rowley <drowley(at)postgresql(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Modify various power 2 calculations to use new helper functions
Date: 2020-04-08 04:55:59
Message-ID: E1jM2kp-0004Jd-N0@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/d025cf88ba5a64487ee4a17ef23e8f55b1536606

Modified Files
--------------
src/backend/access/hash/hashpage.c | 24 +++++++++++-------------
src/backend/access/hash/hashsort.c | 3 ++-
src/backend/access/hash/hashutil.c | 19 ++-----------------
src/backend/utils/hash/dynahash.c | 14 +++++++-------
src/include/access/hash.h | 1 -
src/include/lib/simplehash.h | 27 ++++-----------------------
src/include/port/pg_bitutils.h | 6 ++++++
7 files changed, 32 insertions(+), 62 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2020-04-08 05:44:52 Re: pgsql: Remove testing for precise LSN/reserved bytes in new TAP test
Previous Message Jeff Davis 2020-04-08 04:32:04 Re: pgsql: Allow partitionwise joins in more cases.