summaryrefslogtreecommitdiff
path: root/src/backend/utils/mmgr/mcxt.c
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2010-02-13 02:34:16 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2010-02-13 02:34:16 +0000
commite08ab7c3127c10d419e91072c68e1bfeaab025b8 (patch)
tree8e46dc2510ed865e15b6a56fbf93bdbb10deb07e /src/backend/utils/mmgr/mcxt.c
parentb95a720a487b5027af1b9e4a12542800598ff5de (diff)
downloadpostgresql-e08ab7c3127c10d419e91072c68e1bfeaab025b8.tar.gz
Support inlining various small performance-critical functions on non-GCC
compilers, by applying a configure check to see if the compiler will accept an unreferenced "static inline foo ..." function without warnings. It is believed that such warnings are the only reason not to declare inlined functions in headers, if the compiler understands "inline" at all. Kurt Harriman
Diffstat (limited to 'src/backend/utils/mmgr/mcxt.c')
-rw-r--r--src/backend/utils/mmgr/mcxt.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index bb4c0e69e5..6d31e4e075 100644
--- a/src/backend/utils/mmgr/mcxt.c
+++ b/src/backend/utils/mmgr/mcxt.c
@@ -14,7 +14,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.68 2010/01/02 16:57:58 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.69 2010/02/13 02:34:12 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -628,11 +628,10 @@ repalloc(void *pointer, Size size)
* MemoryContextSwitchTo
* Returns the current context; installs the given context.
*
- * This is inlined when using GCC.
- *
- * TODO: investigate supporting inlining for some non-GCC compilers.
+ * palloc.h defines an inline version of this function if allowed by the
+ * compiler; in which case the definition below is skipped.
*/
-#ifndef __GNUC__
+#ifndef USE_INLINE
MemoryContext
MemoryContextSwitchTo(MemoryContext context)
@@ -645,7 +644,7 @@ MemoryContextSwitchTo(MemoryContext context)
CurrentMemoryContext = context;
return old;
}
-#endif /* ! __GNUC__ */
+#endif /* ! USE_INLINE */
/*
* MemoryContextStrdup