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

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Is it really such a good thing for newNode() to be a macro?
Дата
Msg-id 22959.1219845997@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Is it really such a good thing for newNode() to be a macro?  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Ответы Re: Is it really such a good thing for newNode() to be a macro?  ("Heikki Linnakangas" <heikki@enterprisedb.com>)
Список 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 по дате отправления:

Предыдущее
От: "Heikki Linnakangas"
Дата:
Сообщение: Re: Is it really such a good thing for newNode() to be a macro?
Следующее
От: Benedek László
Дата:
Сообщение: Re: pg_dump roles support