mirror of
https://github.com/postgres/postgres.git
synced 2025-07-15 19:21:59 +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:
@ -6,7 +6,7 @@
|
||||
* Copyright (c) 2002, PostgreSQL Global Development Group
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.11 2002/12/15 16:17:42 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/commands/prepare.c,v 1.12 2002/12/15 21:01:34 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@ -256,9 +256,9 @@ StoreQuery(const char *stmt_name, List *query_list, List *plan_list,
|
||||
/* Make a permanent memory context for the hashtable entry */
|
||||
entrycxt = AllocSetContextCreate(TopMemoryContext,
|
||||
stmt_name,
|
||||
1024,
|
||||
1024,
|
||||
ALLOCSET_DEFAULT_MAXSIZE);
|
||||
ALLOCSET_SMALL_MINSIZE,
|
||||
ALLOCSET_SMALL_INITSIZE,
|
||||
ALLOCSET_SMALL_MAXSIZE);
|
||||
|
||||
oldcxt = MemoryContextSwitchTo(entrycxt);
|
||||
|
||||
|
Reference in New Issue
Block a user