Skip to content

Commit 01187f3

Browse files
committed
Back-patch addition of the ALLOCSET_FOO_SIZES macros.
These macros were originally added in commit ea268cd, 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
1 parent 6e63e06 commit 01187f3

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

src/include/utils/memutils.h

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,14 +132,26 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
132132
#define ALLOCSET_DEFAULT_MINSIZE 0
133133
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024)
134134
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024)
135+
#define ALLOCSET_DEFAULT_SIZES \
136+
ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
135137

136138
/*
137-
* Recommended alloc parameters for "small" contexts that are not expected
139+
* Recommended alloc parameters for "small" contexts that are never expected
138140
* to contain much data (for example, a context to contain a query plan).
139141
*/
140142
#define ALLOCSET_SMALL_MINSIZE 0
141143
#define ALLOCSET_SMALL_INITSIZE (1 * 1024)
142144
#define ALLOCSET_SMALL_MAXSIZE (8 * 1024)
145+
#define ALLOCSET_SMALL_SIZES \
146+
ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE
147+
148+
/*
149+
* Recommended alloc parameters for contexts that should start out small,
150+
* but might sometimes grow big.
151+
*/
152+
#define ALLOCSET_START_SMALL_SIZES \
153+
ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
154+
143155

144156
/*
145157
* Threshold above which a request in an AllocSet context is certain to be

0 commit comments

Comments
 (0)