Re: Convert macros to static inline functions

Amul Sul <sulamul@gmail.com>

From: Amul Sul <sulamul@gmail.com>
To: Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2022-10-04T06:57:25Z
Lists: pgsql-hackers
On Tue, Oct 4, 2022 at 12:00 PM Peter Eisentraut
<peter.eisentraut@enterprisedb.com> 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 placed outside of the IF-block and braces can
be removed.

> (IMO it's questionable whether this one should be an inline function or
> macro at all, rather than a normal external function.)
IMO, it should be inlined with RelationGetSmgr().

Regards,
Amul



Commits

  1. Add some const decorations (htup.h)

  2. Convert macros to static inline functions (htup_details.h, itup.h)

  3. Convert macros to static inline functions (rel.h)

  4. Convert macros to static inline functions (itup.h)

  5. Convert macros to static inline functions (tupmacs.h)

  6. Convert macros to static inline functions (xlog_internal.h)

  7. Convert macros to static inline functions (bufmgr.h)

  8. Convert macros to static inline functions (itemptr.h)

  9. Convert macros to static inline functions (bufpage.h)

  10. Convert macros to static inline functions (block.h)