Simplify newNode()

From: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Simplify newNode()
Date: 2023-12-14 00:48:36
Message-ID: b51f1fa7-7e6a-4ecc-936d-90a8a1659e7c@iki.fi
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Content-Type Size
0001-Convert-newNode-into-a-static-inline-function.patch text/x-patch 4.7 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zhang Mingli 2023-12-14 01:17:33 useless LIMIT_OPTION_DEFAULT
Previous Message James Coleman 2023-12-14 00:35:01 Re: Teach predtest about IS [NOT] <boolean> proofs