aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2005-05-14 23:16:29 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2005-05-14 23:16:29 +0000
commitc8a6b527050806d3e12d6002db16d5b93c644303 (patch)
tree267eb843a10cc3b90fbdaecd4474a8274c695461
parentfabef3044adbf167e08ff3015923a2ba0dc98546 (diff)
downloadpostgresql-c8a6b527050806d3e12d6002db16d5b93c644303.tar.gz
postgresql-c8a6b527050806d3e12d6002db16d5b93c644303.zip
Further marginal speed hacking: in MemoryContextReset, don't call
MemoryContextResetChildren unless necessary.
-rw-r--r--src/backend/utils/mmgr/mcxt.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/backend/utils/mmgr/mcxt.c b/src/backend/utils/mmgr/mcxt.c
index c5a2311bc5e..6d68e30f7eb 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.54 2005/02/18 21:52:33 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/mmgr/mcxt.c,v 1.55 2005/05/14 23:16:29 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -123,7 +123,10 @@ MemoryContextReset(MemoryContext context)
{
AssertArg(MemoryContextIsValid(context));
- MemoryContextResetChildren(context);
+ /* save a function call in common case where there are no children */
+ if (context->firstchild != NULL)
+ MemoryContextResetChildren(context);
+
(*context->methods->reset) (context);
}