Tweak default memory context allocation policy so that a context is not
Tom Lane <tgl@sss.pgh.pa.us>
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.
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/commands/prepare.c | modified | +4 −4 |
| src/backend/commands/trigger.c | modified | +4 −9 |
| src/backend/executor/execJunk.c | modified | +1 −35 |
| src/backend/executor/execMain.c | modified | +8 −15 |
| src/backend/executor/spi.c | modified | +4 −4 |
| src/backend/utils/cache/relcache.c | modified | +10 −10 |
| src/backend/utils/mmgr/aset.c | modified | +21 −5 |
| src/backend/utils/mmgr/mcxt.c | modified | +2 −2 |
| src/include/executor/executor.h | modified | +1 −2 |
| src/include/nodes/execnodes.h | modified | +1 −11 |
| src/include/utils/memutils.h | modified | +10 −2 |