Kevin Grittner <kgri...@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


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

Reply via email to