Simplify newNode()
Heikki Linnakangas <hlinnaka@iki.fi>
From: Heikki Linnakangas <hlinnaka@iki.fi>
To: pgsql-hackers <pgsql-hackers@postgresql.org>
Date: 2023-12-14T00:48:36Z
Lists: pgsql-hackers
Attachments
- 0001-Convert-newNode-into-a-static-inline-function.patch (text/x-patch) patch 0001
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)
Commits
-
Simplify newNode() by removing special cases
- 3c080fb4fad3 17.0 landed