Re: [HACKERS] Candidate for local inline function?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [HACKERS] Candidate for local inline function?
Дата
Msg-id 29050.1489782593@sss.pgh.pa.us
обсуждение исходный текст
Ответ на [HACKERS] Candidate for local inline function?  (Kevin Grittner <kgrittn@gmail.com>)
Список pgsql-hackers
Kevin Grittner <kgrittn@gmail.com> writes:
> Why do we warn of a hazard here instead of eliminating said hazard
> with a static inline function declaration in executor.h?

> /*
>  * ExecEvalExpr was formerly a function containing a switch statement;
>  * now it's just a macro invoking the function pointed to by an ExprState
>  * node.  Beware of double evaluation of the ExprState argument!
>  */
> #define ExecEvalExpr(expr, econtext, isNull) \
>     ((*(expr)->evalfunc) (expr, econtext, isNull))

> Should I change that to a static inline function doing exactly what
> the macro does?

No, because that code has only days to live anyway.  You'd just
create a merge hazard for Andres' execQual rewrite.

In practice, I seriously doubt that there are or ever will be any
callers passing volatile expressions to this macro, so that there's
not really much advantage to be gained by assuming that the compiler
is smart about inline functions.
        regards, tom lane



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Kevin Grittner
Дата:
Сообщение: Re: [HACKERS] Candidate for local inline function?
Следующее
От: Pavel Stehule
Дата:
Сообщение: [HACKERS] Re: new set of psql patches for loading (saving) data from (to) text,binary files