summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-03-22 20:13:09 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-03-22 20:13:09 +0000
commitbd9b4a9d46600eeadbb8420d45a29b819c73bba7 (patch)
tree4e52f6b63d645c464315237d4976d40895369758 /src/include
parent94e03330cbd163378e43094388f87fcba4801ba8 (diff)
downloadpostgresql-bd9b4a9d46600eeadbb8420d45a29b819c73bba7.tar.gz
Use InitFunctionCallInfoData() macro instead of MemSet in performance
critical places in execQual. By Atsushi Ogawa; some minor cleanup by moi.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/fmgr.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/include/fmgr.h b/src/include/fmgr.h
index c366cf965c..0c11130053 100644
--- a/src/include/fmgr.h
+++ b/src/include/fmgr.h
@@ -11,7 +11,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.36 2004/12/31 22:03:19 pgsql Exp $
+ * $PostgreSQL: pgsql/src/include/fmgr.h,v 1.37 2005/03/22 20:13:09 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -87,6 +87,22 @@ extern void fmgr_info_copy(FmgrInfo *dstinfo, FmgrInfo *srcinfo,
MemoryContext destcxt);
/*
+ * This macro initializes all the fields of a FunctionCallInfoData except
+ * for the arg[] and argnull[] arrays. Performance testing has shown that
+ * the fastest way to set up argnull[] for small numbers of arguments is to
+ * explicitly set each required element to false, so we don't try to zero
+ * out the argnull[] array in the macro.
+ */
+#define InitFunctionCallInfoData(Fcinfo, Flinfo, Nargs, Context, Resultinfo) \
+ do { \
+ (Fcinfo).flinfo = (Flinfo); \
+ (Fcinfo).context = (Context); \
+ (Fcinfo).resultinfo = (Resultinfo); \
+ (Fcinfo).isnull = false; \
+ (Fcinfo).nargs = (Nargs); \
+ } while (0)
+
+/*
* This macro invokes a function given a filled-in FunctionCallInfoData
* struct. The macro result is the returned Datum --- but note that
* caller must still check fcinfo->isnull! Also, if function is strict,