The newNode() macro can be turned into a static inline function, which
makes it a lot simpler. See attached. This was not possible when the
macro was originally written, as we didn't require compiler to have
static inline support, but nowadays we do.
This was last discussed in 2008, see discussion at
https://www.postgresql.org/message-id/26133.1220037409%40sss.pgh.pa.us.
In those tests, Tom observed that gcc refused to inline the static
inline function. That was weird, the function is very small and doesn't
do anything special. Whatever the problem was, I think we can dismiss it
with modern compilers. It does get inlined on gcc 12 and clang 14 that I
have installed.
--
Heikki Linnakangas
Neon (https://neon.tech)