Simplify newNode() - Mailing list pgsql-hackers

From Heikki Linnakangas
Subject Simplify newNode()
Date
Msg-id b51f1fa7-7e6a-4ecc-936d-90a8a1659e7c@iki.fi
Whole thread Raw
Responses Re: Simplify newNode()
Re: Simplify newNode()
List pgsql-hackers
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)
Attachment

pgsql-hackers by date:

Previous
From: James Coleman
Date:
Subject: Re: Teach predtest about IS [NOT] proofs
Next
From: Zhang Mingli
Date:
Subject: useless LIMIT_OPTION_DEFAULT