Skip to content

Commit ec18574

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 c7b96ba commit ec18574

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
@@ -136,14 +136,26 @@ extern MemoryContext AllocSetContextCreate(MemoryContext parent,
136136
#define ALLOCSET_DEFAULT_MINSIZE 0
137137
#define ALLOCSET_DEFAULT_INITSIZE (8 * 1024)
138138
#define ALLOCSET_DEFAULT_MAXSIZE (8 * 1024 * 1024)
139+
#define ALLOCSET_DEFAULT_SIZES \
140+
ALLOCSET_DEFAULT_MINSIZE, ALLOCSET_DEFAULT_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
139141

140142
/*
141-
* Recommended alloc parameters for "small" contexts that are not expected
143+
* Recommended alloc parameters for "small" contexts that are never expected
142144
* to contain much data (for example, a context to contain a query plan).
143145
*/
144146
#define ALLOCSET_SMALL_MINSIZE 0
145147
#define ALLOCSET_SMALL_INITSIZE (1 * 1024)
146148
#define ALLOCSET_SMALL_MAXSIZE (8 * 1024)
149+
#define ALLOCSET_SMALL_SIZES \
150+
ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_SMALL_MAXSIZE
151+
152+
/*
153+
* Recommended alloc parameters for contexts that should start out small,
154+
* but might sometimes grow big.
155+
*/
156+
#define ALLOCSET_START_SMALL_SIZES \
157+
ALLOCSET_SMALL_MINSIZE, ALLOCSET_SMALL_INITSIZE, ALLOCSET_DEFAULT_MAXSIZE
158+
147159

148160
/*
149161
* Threshold above which a request in an AllocSet context is certain to be

0 commit comments

Comments
 (0)