Re: Remove traces of long in dynahash.c - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove traces of long in dynahash.c
Date
Msg-id 577163.1755614818@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove traces of long in dynahash.c  (Chao Li <li.evan.chao@gmail.com>)
Responses Re: Remove traces of long in dynahash.c
List pgsql-hackers
Chao Li <li.evan.chao@gmail.com> writes:
>> On Aug 19, 2025, at 14:24, Michael Paquier <michael@paquier.xyz> wrote:
>> <0001-Replace-uses-of-long-by-uint64-in-dynahash.c-and-hse.patch>

> There are already pg_nextpower2_64() and pg_nextpower2_32() in pg_bitutils.h, feels like the new replacement
functionsare duplicate to the existing ones. 

It always seemed weird to me that dynahash.c has its own bit-twiddling
functions.  (There are indications in the source code that it was once
a standalone test program, which perhaps explains that.)
+1 for getting rid of those while we're doing janitorial work here.
They're not *quite* duplicates though, for instance next_pow2_int has
different response to out-of-range values than pg_nextpower2_32.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Fujii Masao
Date:
Subject: Re: analyze-in-stages post upgrade questions
Next
From: Thomas Munro
Date:
Subject: Re: VM corruption on standby