Re: Remove traces of long in dynahash.c

Tom Lane <tgl@sss.pgh.pa.us>

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Chao Li <li.evan.chao@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>, Postgres hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-08-19T14:46:58Z
Lists: 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 functions are 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



Commits

  1. Remove dynahash.h

  2. Replace callers of dynahash.h's my_log() by equivalent in pg_bitutils.h

  3. Change dynahash.c and hsearch.h to use int64 instead of long