Re: Is it really such a good thing for newNode() to be a macro? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Is it really such a good thing for newNode() to be a macro?
Date
Msg-id 22959.1219845997@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is it really such a good thing for newNode() to be a macro?  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Responses Re: Is it really such a good thing for newNode() to be a macro?  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
List pgsql-hackers
"Heikki Linnakangas" <heikki@enterprisedb.com> writes:
> Tom Lane wrote:
>> I happened to be looking at nodes.h and started wondering just how
>> sane this coding really is:

> Note that the MemSetLoop macro used in palloc0fast is supposed to be 
> evaluated at compile time,

Oooh, good point, I had forgotten about that little detail.  Yeah,
we'll lose that optimization if we move the code out-of-line.

So I guess a fallback position is #if __gcc__ use a "static inline"
function, else the existing code.  That would at least let us get
rid of the global-variable assignment in gcc-based builds.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Heikki Linnakangas"
Date:
Subject: Re: Is it really such a good thing for newNode() to be a macro?
Next
From: Benedek László
Date:
Subject: Re: pg_dump roles support