1
0
mirror of https://github.com/postgres/postgres.git synced 2025-10-27 00:12:01 +03:00

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.
This commit is contained in:
Tom Lane
2002-12-15 21:01:34 +00:00
parent 5bab36e9f6
commit e64c7feb2f
11 changed files with 66 additions and 99 deletions

View File

@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.80 2002/12/15 16:17:46 tgl Exp $
* $Header: /cvsroot/pgsql/src/backend/executor/spi.c,v 1.81 2002/12/15 21:01:34 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1489,9 +1489,9 @@ _SPI_copy_plan(_SPI_plan *plan, int location)
*/
plancxt = AllocSetContextCreate(parentcxt,
"SPI Plan",
1024,
1024,
ALLOCSET_DEFAULT_MAXSIZE);
ALLOCSET_SMALL_MINSIZE,
ALLOCSET_SMALL_INITSIZE,
ALLOCSET_SMALL_MAXSIZE);
oldcxt = MemoryContextSwitchTo(plancxt);
/* Copy the SPI plan into its own context */