Re: Remove fls(), use pg_bitutils.h facilities instead?

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

From: Tom Lane <tgl@sss.pgh.pa.us>
To: Thomas Munro <thomas.munro@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>, David Rowley <dgrowleyml@gmail.com>
Date: 2022-07-20T13:48:36Z
Lists: pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> That double eval macro wasn't nice.  This time with a static inline function.

Seems like passing a size_t to pg_leftmost_one_pos32 isn't great.
It was just as wrong before (if the caller-supplied argument is
indeed a size_t), but no time like the present to fix it.

We could have pg_bitutils.h #define pg_leftmost_one_pos_size_t
as the appropriate one of pg_leftmost_one_pos32/64, perhaps.

			regards, tom lane



Commits

  1. Remove fls(), use pg_leftmost_one_pos32() instead.

  2. Extend size_t support in pg_bitutils.h.

  3. Support fls().