Re: Convert macros to static inline functions

2025-02-11 Thread Peter Eisentraut
On 31.01.25 14:29, Maxim Orlov wrote: Great job! I've been working on the 64 XIDs patch for years, and I've never liked this place.  On the other hand, as we know, inlining does not always work since it only suggests to the compiler to do it. After all, many of these calls are used in pretty "ho

Re: Convert macros to static inline functions

2025-01-31 Thread Maxim Orlov
On Thu, 23 Jan 2025 at 14:39, Peter Eisentraut < peter.eisentr...@enterprisedb.com> wrote: > On 27.12.24 11:16, Peter Eisentraut wrote: > > On 16.05.22 10:27, Peter Eisentraut wrote: > >> Inspired by [0], I looked to convert more macros to inline functions. > > > > This is an older thread where I

Re: Convert macros to static inline functions

2025-01-23 Thread Peter Eisentraut
On 27.12.24 11:16, Peter Eisentraut wrote: On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. This is an older thread where I left something unfinished: Note 2: Many macros in htup_details.h operate both on HeapTupleHeader and on

Re: Convert macros to static inline functions

2024-12-27 Thread Peter Eisentraut
On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. This is an older thread where I left something unfinished: Note 2: Many macros in htup_details.h operate both on HeapTupleHeader and on MinimalTuple, so converting them to a functi

Re: Convert macros to static inline functions

2022-10-07 Thread Peter Eisentraut
On 04.10.22 08:57, Amul Sul wrote: On Tue, Oct 4, 2022 at 12:00 PM Peter Eisentraut wrote: On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. Here is another one from the same batch of work that I somehow didn't send in last time

Re: Convert macros to static inline functions

2022-10-03 Thread Amul Sul
On Tue, Oct 4, 2022 at 12:00 PM Peter Eisentraut wrote: > > On 16.05.22 10:27, Peter Eisentraut wrote: > > Inspired by [0], I looked to convert more macros to inline functions. > > Here is another one from the same batch of work that I somehow didn't > send in last time. > I think assertion can be

Re: Convert macros to static inline functions

2022-10-03 Thread Peter Eisentraut
On 16.05.22 10:27, Peter Eisentraut wrote: Inspired by [0], I looked to convert more macros to inline functions. Here is another one from the same batch of work that I somehow didn't send in last time. (IMO it's questionable whether this one should be an inline function or macro at all, rat

Re: Convert macros to static inline functions

2022-06-08 Thread Peter Geoghegan
On Mon, May 16, 2022 at 1:28 AM Peter Eisentraut wrote: > Inspired by [0], I looked to convert more macros to inline functions. > The attached patches are organized "bottom up" in terms of their API > layering; some of the later ones depend on some of the earlier ones. Big +1 from me. I converte

Re: Convert macros to static inline functions

2022-05-22 Thread Peter Eisentraut
On 16.05.22 15:23, Amul Sul wrote: +static inline OffsetNumber +PageGetMaxOffsetNumber(Page page) +{ + if (((PageHeader) page)->pd_lower <= SizeOfPageHeaderData) + return 0; + else + return PageHeader) page)->pd_lower - SizeOfPageHeaderData) / sizeof(ItemIdData)); +} The "els

Re: Convert macros to static inline functions

2022-05-16 Thread Alvaro Herrera
On 2022-May-16, Amul Sul wrote: > +static inline OffsetNumber > +PageGetMaxOffsetNumber(Page page) > +{ > + if (((PageHeader) page)->pd_lower <= SizeOfPageHeaderData) > + return 0; > + else > + return PageHeader) page)->pd_lower - SizeOfPageHeaderData) > / sizeof(ItemIdData));

Re: Convert macros to static inline functions

2022-05-16 Thread Amul Sul
On Mon, May 16, 2022 at 1:58 PM Peter Eisentraut wrote: > > > Inspired by [0], I looked to convert more macros to inline functions. > The attached patches are organized "bottom up" in terms of their API > layering; some of the later ones depend on some of the earlier ones. > All the patches look