Re: Remove dependence on integer wrapping - Mailing list pgsql-hackers

From Alexander Lakhin
Subject Re: Remove dependence on integer wrapping
Date
Msg-id e5d3f013-e206-835c-0c08-53c786b098f2@gmail.com
Whole thread Raw
In response to Re: Remove dependence on integer wrapping  (Joseph Koshakow <koshy44@gmail.com>)
List pgsql-hackers
18.08.2024 00:52, Joseph Koshakow wrote:
> The largest possible (theoretical) value for `nbuckets` is
> `1073741824`, the largest power of 2 that fits into an `int`. So, the
> largest possible value for `nbuckets << 1` is `2147483648`. This can
> fully fit in a `uint32`, so the simple fix for this case is to cast
> `nbuckets` to a `uint32` before shifting. I've attached this fix,
> Alexander if you have time I would appreciate if you were able to test
> it.
>

Yes, I've tested v25-0002-*.patch and can confirm that this fix works
as well.

Best regards,
Alexander



pgsql-hackers by date:

Previous
From: "Zhijie Hou (Fujitsu)"
Date:
Subject: RE: Conflict detection and logging in logical replication
Next
From: Peter Eisentraut
Date:
Subject: Re: macOS prefetching support