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

Поиск
Список
Период
Сортировка
От David Rowley
Тема pgsql: Modify various power 2 calculations to use new helper functions
Дата
Msg-id E1jM2kp-0004Jd-N0@gemulon.postgresql.org
обсуждение исходный текст
Список 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(-)


В списке pgsql-committers по дате отправления:

Предыдущее
От: Jeff Davis
Дата:
Сообщение: Re: pgsql: Allow partitionwise joins in more cases.
Следующее
От: Kyotaro Horiguchi
Дата:
Сообщение: Re: pgsql: Remove testing for precise LSN/reserved bytes in newTAP test