diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-15 21:01:34 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2002-12-15 21:01:34 +0000 |
commit | e64c7feb2fd80c89d2220cbe9e026a031f34509c (patch) | |
tree | b7842bbf8efc3b7849b29c8a1b67a4a196f9ee2e /src/backend/utils/cache/relcache.c | |
parent | 5bab36e9f6c3f3a9e14a89e1124179a339d2c3a1 (diff) | |
download | postgresql-e64c7feb2fd80c89d2220cbe9e026a031f34509c.tar.gz postgresql-e64c7feb2fd80c89d2220cbe9e026a031f34509c.zip |
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.
Diffstat (limited to 'src/backend/utils/cache/relcache.c')
-rw-r--r-- | src/backend/utils/cache/relcache.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c index 38c2c5016ef..87992769e99 100644 --- a/src/backend/utils/cache/relcache.c +++ b/src/backend/utils/cache/relcache.c @@ -8,7 +8,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.181 2002/11/15 17:18:49 tgl Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/cache/relcache.c,v 1.182 2002/12/15 21:01:34 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -647,9 +647,9 @@ RelationBuildRuleLock(Relation relation) */ rulescxt = AllocSetContextCreate(CacheMemoryContext, RelationGetRelationName(relation), - 0, /* minsize */ - 1024, /* initsize */ - 1024); /* maxsize */ + ALLOCSET_SMALL_MINSIZE, + ALLOCSET_SMALL_INITSIZE, + ALLOCSET_SMALL_MAXSIZE); relation->rd_rulescxt = rulescxt; /* @@ -994,9 +994,9 @@ RelationInitIndexAccessInfo(Relation relation) */ indexcxt = AllocSetContextCreate(CacheMemoryContext, RelationGetRelationName(relation), - 0, /* minsize */ - 512, /* initsize */ - 1024); /* maxsize */ + ALLOCSET_SMALL_MINSIZE, + ALLOCSET_SMALL_INITSIZE, + ALLOCSET_SMALL_MAXSIZE); relation->rd_indexcxt = indexcxt; /* @@ -2851,9 +2851,9 @@ load_relcache_init_file(void) */ indexcxt = AllocSetContextCreate(CacheMemoryContext, RelationGetRelationName(rel), - 0, /* minsize */ - 512, /* initsize */ - 1024); /* maxsize */ + ALLOCSET_SMALL_MINSIZE, + ALLOCSET_SMALL_INITSIZE, + ALLOCSET_SMALL_MAXSIZE); rel->rd_indexcxt = indexcxt; /* next, read the index strategy map */ |