pgsql.hackers
[Top] [All Lists]

Re: Is it really such a good thing for newNode() to be a macro?

Subject: Re: Is it really such a good thing for newNode() to be a macro?
From: Tom Lane
Date: Wed, 27 Aug 2008 10:06:37 -0400
Newsgroups: pgsql.hackers

"Heikki Linnakangas" <heikki@xxxxxxxxxxxxxxxx> 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

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers


<Prev in Thread] Current Thread [Next in Thread>
Privacy Policy