From: David Rowley <drowley@postgresql.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Modify various power 2 calculations to use new helper functions
Date: Wed, 08 Apr 2020 04:55:59 +0000
Message-ID: <E1jM2kp-0004Jd-N0@gemulon.postgresql.org> (raw)
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(-)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-committers@postgresql.org
Cc: drowley@postgresql.org
Subject: Re: pgsql: Modify various power 2 calculations to use new helper functions
In-Reply-To: <E1jM2kp-0004Jd-N0@gemulon.postgresql.org>
References: <E1jM2kp-0004Jd-N0@gemulon.postgresql.org>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox