Re: Remove fls(), use pg_bitutils.h facilities instead? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Remove fls(), use pg_bitutils.h facilities instead?
Date
Msg-id 2248192.1658411165@sss.pgh.pa.us
Whole thread Raw
In response to Re: Remove fls(), use pg_bitutils.h facilities instead?  (Thomas Munro <thomas.munro@gmail.com>)
List pgsql-hackers
Thomas Munro <thomas.munro@gmail.com> writes:
> On Thu, Jul 21, 2022 at 1:34 AM Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> How is it sane to ask for a segment bin for zero pages?  Seems like
>> something should have short-circuited such a case well before here.

> It's intended.  There are two ways you can arrive here with n == 0:

OK.

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

> Yeah.

Patches look good to me.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Yura Sokolov
Date:
Subject: Re: SLRUs in the main buffer pool, redux
Next
From: Amit Kapila
Date:
Subject: Re: [PATCH v1] eliminate duplicate code in table.c