On Sun, 13 Jun 2021 at 00:31, David Rowley 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 th
On Sat, Jun 12, 2021 at 7:35 AM David Rowley wrote:
> On Sun, 13 Jun 2021 at 02:08, Zhihong Yu wrote:
> > Maybe add an assertion after the assignment, that newalloc >=
> LWLockTrancheNamesAllocated.
>
> I don't quite see how it would be possible for that to ever fail. I
> could understand addin
On Sun, 13 Jun 2021 at 02:08, Zhihong Yu wrote:
> Maybe add an assertion after the assignment, that newalloc >=
> LWLockTrancheNamesAllocated.
I don't quite see how it would be possible for that to ever fail. I
could understand adding an Assert() if some logic was outside the
function and we w
On Sat, Jun 12, 2021 at 6:40 AM David Rowley wrote:
> Thanks for having a look.
>
> On Sun, 13 Jun 2021 at 00:50, Zhihong Yu wrote:
> > - newalloc = Max(LWLockTrancheNamesAllocated, 8);
> > - while (newalloc <= tranche_id)
> > - newalloc *= 2;
> > + newalloc = pg_next
Thanks for having a look.
On Sun, 13 Jun 2021 at 00:50, Zhihong Yu wrote:
> - newalloc = Max(LWLockTrancheNamesAllocated, 8);
> - while (newalloc <= tranche_id)
> - newalloc *= 2;
> + newalloc = pg_nextpower2_32(Max(8, tranche_id + 1));
>
> Should LWLockTrancheNamesAll
On Sat, Jun 12, 2021 at 5:32 AM David Rowley 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 t
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. T