aboutsummaryrefslogtreecommitdiff
path: root/src/include/utils/memutils.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2002-12-15 21:01:34 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2002-12-15 21:01:34 +0000
commite64c7feb2fd80c89d2220cbe9e026a031f34509c (patch)
treeb7842bbf8efc3b7849b29c8a1b67a4a196f9ee2e /src/include/utils/memutils.h
parent5bab36e9f6c3f3a9e14a89e1124179a339d2c3a1 (diff)
downloadpostgresql-e64c7feb2fd80c89d2220cbe9e026a031f34509c.tar.gz
postgresql-e64c7feb2fd80c89d2220cbe9e026a031f34509c.zip
Tweak default memory context allocation policy so that a context is not
given any malloc block until something is first allocated in it; but thereafter, MemoryContextReset won't release that first malloc block. This preserves the quick-reset property of the original policy, without forcing 8K to be allocated to every context whether any of it is ever used or not. Also, remove some more no-longer-needed explicit freeing during ExecEndPlan.
Diffstat (limited to 'src/include/utils/memutils.h')
-rw-r--r--src/include/utils/memutils.h12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index 8529f948227..94578b8fb6f 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: memutils.h,v 1.48 2002/09/04 20:31:45 momjian Exp $
+ * $Id: memutils.h,v 1.49 2002/12/15 21:01:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -116,8 +116,16 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
* Recommended default alloc parameters, suitable for "ordinary" contexts
* that might hold quite a lot of data.
*/
-#define ALLOCSET_DEFAULT_MINSIZE (8 * 1024)
+#define ALLOCSET_DEFAULT_MINSIZE 0
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024)
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024)
+/*
+ * Recommended alloc parameters for "small" contexts that are not expected
+ * to contain much data (for example, a context to contain a query plan).
+ */
+#define ALLOCSET_SMALL_MINSIZE 0
+#define ALLOCSET_SMALL_INITSIZE (1 * 1024)
+#define ALLOCSET_SMALL_MAXSIZE (8 * 1024)
+
#endif /* MEMUTILS_H */