Re: Use pg_nextpower2_* in a few more places

David Rowley <dgrowleyml@gmail.com>

From: David Rowley <dgrowleyml@gmail.com>
To: PostgreSQL Developers <pgsql-hackers@lists.postgresql.org>
Date: 2021-06-30T12:24:19Z
Lists: pgsql-hackers
On Sun, 13 Jun 2021 at 00:31, David Rowley <dgrowleyml@gmail.com> wrote:
>
> Back in f0705bb62, we added pg_nextpower2_32 and pg_nextpower2_64 to
> efficiently obtain the next power of 2 of a given number using an
> intrinsic function to find the left-most 1 bit.
>
> In d025cf88b and 02a2e8b44, I added some usages of these new functions
> but I didn't quite get all of them done.   The attached replaces all
> of the remaining ones that I'm happy enough to go near.

> I'd like to fix these for PG15.

I had another look over this patch and it looks ok to me. I plan to
push it in the next day or so.

David



Commits

  1. Improve various places that double the size of a buffer