summaryrefslogtreecommitdiff
path: root/src/backend/rewrite/rewriteSupport.c
diff options
context:
space:
mode:
authorTom Lane2000-06-28 03:33:33 +0000
committerTom Lane2000-06-28 03:33:33 +0000
commit1aebc3618a0be13451918581ad390ad9a3518702 (patch)
treee8ab228245c43ff086bd8e9d65baf3d1d9a5f96a /src/backend/rewrite/rewriteSupport.c
parentb601c8d8828ee02ffb195dead82b233b9572fe32 (diff)
First phase of memory management rewrite (see backend/utils/mmgr/README
for details). It doesn't really do that much yet, since there are no short-term memory contexts in the executor, but the infrastructure is in place and long-term contexts are handled reasonably. A few long- standing bugs have been fixed, such as 'VACUUM; anything' in a single query string crashing. Also, out-of-memory is now considered a recoverable ERROR, not FATAL. Eliminate a large amount of crufty, now-dead code in and around memory management. Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and backend startup.
Diffstat (limited to 'src/backend/rewrite/rewriteSupport.c')
-rw-r--r--src/backend/rewrite/rewriteSupport.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/backend/rewrite/rewriteSupport.c b/src/backend/rewrite/rewriteSupport.c
index 9a5f4862410..113e0b73c59 100644
--- a/src/backend/rewrite/rewriteSupport.c
+++ b/src/backend/rewrite/rewriteSupport.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.41 2000/01/26 05:56:50 momjian Exp $
+ * $Header: /cvsroot/pgsql/src/backend/rewrite/rewriteSupport.c,v 1.42 2000/06/28 03:31:56 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -136,7 +136,7 @@ prs2_addToRelation(Oid relid,
* create an in memory RewriteRule data structure which is cached by
* every Relation descriptor. (see utils/cache/relcache.c)
*/
- oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
thisRule = (RewriteRule *) palloc(sizeof(RewriteRule));
if (qual != NULL)
qual = copyObject(qual);
@@ -159,7 +159,7 @@ prs2_addToRelation(Oid relid,
if (relation->rd_rules == NULL)
{
- oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
rulelock = (RuleLock *) palloc(sizeof(RuleLock));
rulelock->numLocks = 1;
rulelock->rules = (RewriteRule **) palloc(sizeof(RewriteRule *));
@@ -181,7 +181,7 @@ prs2_addToRelation(Oid relid,
rulelock = relation->rd_rules;
numlock = rulelock->numLocks;
/* expand, for safety reasons */
- oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
rulelock->rules = (RewriteRule **) repalloc(rulelock->rules,
sizeof(RewriteRule *) * (numlock + 1));
MemoryContextSwitchTo(oldcxt);
@@ -212,7 +212,7 @@ prs2_deleteFromRelation(Oid relid, Oid ruleId)
break;
}
Assert(i < numlock);
- oldcxt = MemoryContextSwitchTo((MemoryContext) CacheCxt);
+ oldcxt = MemoryContextSwitchTo(CacheMemoryContext);
pfree(rulelock->rules[i]);
MemoryContextSwitchTo(oldcxt);
if (numlock == 1)