Re: Convert varatt.h macros to static inline functions - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Convert varatt.h macros to static inline functions
Date
Msg-id 2199599.1754024853@sss.pgh.pa.us
Whole thread Raw
In response to Re: Convert varatt.h macros to static inline functions  (Michael Paquier <michael@paquier.xyz>)
List pgsql-hackers
Michael Paquier <michael@paquier.xyz> writes:
> Another comment that can apply to all the patches presented on this
> thread.  Could it be worth splitting these inline functions into a
> separate header that declares varatt.h, meaning that we'd need to
> think a bit more about the structures themselves and all the
> sub-macros like SET_VARSIZE_1B() & friends?

IIRC we already moved these macros out of postgres.h, some years ago.

I don't really see how we could hide the lower-level macros from
callers' eyes while still having them available to inline functions.
The point of this exercise IMO is not information hiding: it is to
be clearer about the input and output datatypes of the functions,
and to eliminate multiple-evaluation hazards.

            regards, tom lane



pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: Logical Replication of sequences
Next
From: Chao Li
Date:
Subject: Re: Should --enable-debug set CFLAGS to -O0 instead of -O2?