summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2018-10-12 14:49:33 -0400
committerTom Lane <tgl@sss.pgh.pa.us>2018-10-12 14:49:33 -0400
commitec185747a46e704fd45a8eaa7f420cc200dcb6e7 (patch)
tree300d4287da7828291134ba163132907ec3e58002 /src
parentc7b96ba291595c13272911ed65cb7c2c4c8cc2e7 (diff)
Back-patch addition of the ALLOCSET_FOO_SIZES macros.
These macros were originally added in commit ea268cdc9, and back-patched into 9.6 before 9.6.0. However, some extensions would like to use them in older branches, and there seems no harm in providing them. So add them to all supported branches. Per suggestions from Christoph Berg and Andres Freund. Discussion: https://postgr.es/m/20181012170355.bhxi273skjt6sag4@alap3.anarazel.de
Diffstat (limited to 'src')
-rw-r--r--src/include/utils/memutils.h14
1 files changed, 13 insertions, 1 deletions
diff --git a/src/include/utils/memutils.h b/src/include/utils/memutils.h
index a0c755daf37..35c064e8766 100644
--- a/src/include/utils/memutils.h
+++ b/src/include/utils/memutils.h
@@ -136,14 +136,26 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
#define ALLOCSET_DEFAULT_MINSIZE 0
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024)
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024)
+#define ALLOCSET_DEFAULT_SIZES \
+ ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
/*
- * Recommended alloc parameters for "small" contexts that are not expected
+ * Recommended alloc parameters for "small" contexts that are never 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)
+#define ALLOCSET_SMALL_SIZES \
+ ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE
+
+/*
+ * Recommended alloc parameters for contexts that should start out small,
+ * but might sometimes grow big.
+ */
+#define ALLOCSET_START_SMALL_SIZES \
+ ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
+
/*
* Threshold above which a request in an AllocSet context is certain to be