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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
Cc: pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Is it really such a good thing for newNode() to be a macro?
Date: 2008-08-27 14:06:37
Message-ID: 22959.1219845997@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Heikki Linnakangas" <heikki(at)enterprisedb(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Benedek László 2008-08-27 14:17:43 Re: pg_dump roles support
Previous Message Heikki Linnakangas 2008-08-27 13:51:02 Re: Is it really such a good thing for newNode() to be a macro?