- Notifications
You must be signed in to change notification settings - Fork5
Commitea268cd
committed
Add macros to make AllocSetContextCreate() calls simpler and safer.
I found that half a dozen (nearly 5%) of our AllocSetContextCreate callshad typos in the context-sizing parameters. While none of these led toespecially significant problems, they did create minor inefficiencies,and it's now clear that expecting people to copy-and-paste those callsaccurately is not a great idea. Let's reduce the risk of future errorsby introducing single macros that encapsulate the common use-cases.Three such macros are enough to cover all but two special-purpose contexts;those two calls can be left as-is, I think.While this patch doesn't in itself improve matters for third-partyextensions, it doesn't break anything for them either, and they cangradually adopt the simplified notation over time.In passing, change TopMemoryContext to use the default allocationparameters. Formerly it could only be extended 8K at a time. That wasprobably reasonable when this code was written; but nowadays we createmany more contexts than we did then, so that it's not unusual to have acouple hundred K in TopMemoryContext, even without considering variousdubious code that sticks other things there. There seems no good reasonnot to let it use growing blocks like most other contexts.Back-patch to 9.6, mostly because that's still close enough to HEAD thatit's easy to do so, and keeping the branches in sync can be expected toavoid some future back-patching pain. The bugs fixed by these changesdon't seem to be significant enough to justify fixing them further back.Discussion: <21072.1472321324@sss.pgh.pa.us>1 parent26fa446 commitea268cd
File tree
99 files changed
+206
-522
lines changed- contrib
- bloom
- dblink
- file_fdw
- pg_trgm
- postgres_fdw
- sepgsql
- test_decoding
- src
- backend
- access
- brin
- common
- gin
- gist
- heap
- nbtree
- spgist
- transam
- bootstrap
- catalog
- commands
- executor
- libpq
- optimizer
- geqo
- util
- postmaster
- replication
- logical
- storage
- buffer
- file
- lmgr
- smgr
- tcop
- tsearch
- utils
- adt
- cache
- fmgr
- hash
- init
- misc
- mmgr
- sort
- include/utils
- pl
- plperl
- plpgsql/src
- plpython
- tcl
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
99 files changed
+206
-522
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
133 | | - | |
134 | | - | |
135 | | - | |
| 133 | + | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
204 | 202 | | |
205 | 203 | | |
206 | 204 | | |
207 | | - | |
208 | | - | |
209 | | - | |
| 205 | + | |
210 | 206 | | |
211 | 207 | | |
212 | 208 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
980 | 980 | | |
981 | 981 | | |
982 | 982 | | |
983 | | - | |
984 | | - | |
985 | | - | |
| 983 | + | |
986 | 984 | | |
987 | 985 | | |
988 | 986 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1061 | 1061 | | |
1062 | 1062 | | |
1063 | 1063 | | |
1064 | | - | |
1065 | | - | |
1066 | | - | |
| 1064 | + | |
1067 | 1065 | | |
1068 | 1066 | | |
1069 | 1067 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
529 | 529 | | |
530 | 530 | | |
531 | 531 | | |
532 | | - | |
533 | | - | |
534 | | - | |
| 532 | + | |
535 | 533 | | |
536 | 534 | | |
537 | 535 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1315 | 1315 | | |
1316 | 1316 | | |
1317 | 1317 | | |
1318 | | - | |
1319 | | - | |
1320 | | - | |
| 1318 | + | |
1321 | 1319 | | |
1322 | 1320 | | |
1323 | | - | |
1324 | | - | |
1325 | | - | |
| 1321 | + | |
1326 | 1322 | | |
1327 | 1323 | | |
1328 | 1324 | | |
| |||
1695 | 1691 | | |
1696 | 1692 | | |
1697 | 1693 | | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
| 1694 | + | |
1701 | 1695 | | |
1702 | 1696 | | |
1703 | 1697 | | |
| |||
2294 | 2288 | | |
2295 | 2289 | | |
2296 | 2290 | | |
2297 | | - | |
2298 | | - | |
2299 | | - | |
| 2291 | + | |
2300 | 2292 | | |
2301 | 2293 | | |
2302 | 2294 | | |
| |||
3481 | 3473 | | |
3482 | 3474 | | |
3483 | 3475 | | |
3484 | | - | |
3485 | | - | |
3486 | | - | |
| 3476 | + | |
3487 | 3477 | | |
3488 | 3478 | | |
3489 | 3479 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
498 | 498 | | |
499 | 499 | | |
500 | 500 | | |
501 | | - | |
| 501 | + | |
502 | 502 | | |
503 | 503 | | |
504 | 504 | | |
505 | | - | |
506 | | - | |
507 | | - | |
| 505 | + | |
508 | 506 | | |
509 | 507 | | |
510 | 508 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
102 | 102 | | |
103 | 103 | | |
104 | 104 | | |
105 | | - | |
106 | | - | |
107 | | - | |
| 105 | + | |
108 | 106 | | |
109 | 107 | | |
110 | 108 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
| 168 | + | |
171 | 169 | | |
172 | 170 | | |
173 | 171 | | |
| |||
347 | 345 | | |
348 | 346 | | |
349 | 347 | | |
350 | | - | |
351 | | - | |
352 | | - | |
| 348 | + | |
353 | 349 | | |
354 | 350 | | |
355 | 351 | | |
| |||
856 | 852 | | |
857 | 853 | | |
858 | 854 | | |
859 | | - | |
860 | | - | |
861 | | - | |
| 855 | + | |
862 | 856 | | |
863 | 857 | | |
864 | 858 | | |
| |||
1169 | 1163 | | |
1170 | 1164 | | |
1171 | 1165 | | |
1172 | | - | |
1173 | | - | |
1174 | | - | |
| 1166 | + | |
1175 | 1167 | | |
1176 | 1168 | | |
1177 | 1169 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
367 | 367 | | |
368 | 368 | | |
369 | 369 | | |
370 | | - | |
371 | | - | |
372 | | - | |
| 370 | + | |
373 | 371 | | |
374 | 372 | | |
375 | 373 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
135 | 135 | | |
136 | 136 | | |
137 | 137 | | |
138 | | - | |
139 | | - | |
140 | | - | |
| 138 | + | |
141 | 139 | | |
142 | 140 | | |
143 | 141 | | |
| |||
0 commit comments
Comments
(0)