aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/cache
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/utils/cache')
-rw-r--r--src/backend/utils/cache/relcache.c29
-rw-r--r--src/backend/utils/cache/ts_cache.c7
2 files changed, 21 insertions, 15 deletions
diff --git a/src/backend/utils/cache/relcache.c b/src/backend/utils/cache/relcache.c
index 12a5f157c0a..3a9233ef3dd 100644
--- a/src/backend/utils/cache/relcache.c
+++ b/src/backend/utils/cache/relcache.c
@@ -669,9 +669,10 @@ RelationBuildRuleLock(Relation relation)
/*
* Make the private context. Assume it'll not contain much data.
*/
- rulescxt = AllocSetContextCreate(CacheMemoryContext,
- RelationGetRelationName(relation),
- ALLOCSET_SMALL_SIZES);
+ rulescxt = AllocSetContextCreateExtended(CacheMemoryContext,
+ RelationGetRelationName(relation),
+ MEMCONTEXT_COPY_NAME,
+ ALLOCSET_SMALL_SIZES);
relation->rd_rulescxt = rulescxt;
/*
@@ -984,9 +985,10 @@ RelationBuildPartitionKey(Relation relation)
ReleaseSysCache(tuple);
/* Success --- now copy to the cache memory */
- partkeycxt = AllocSetContextCreate(CacheMemoryContext,
- RelationGetRelationName(relation),
- ALLOCSET_SMALL_SIZES);
+ partkeycxt = AllocSetContextCreateExtended(CacheMemoryContext,
+ RelationGetRelationName(relation),
+ MEMCONTEXT_COPY_NAME,
+ ALLOCSET_SMALL_SIZES);
relation->rd_partkeycxt = partkeycxt;
oldcxt = MemoryContextSwitchTo(relation->rd_partkeycxt);
relation->rd_partkey = copy_partition_key(key);
@@ -1566,9 +1568,10 @@ RelationInitIndexAccessInfo(Relation relation)
* a context, and not just a couple of pallocs, is so that we won't leak
* any subsidiary info attached to fmgr lookup records.
*/
- indexcxt = AllocSetContextCreate(CacheMemoryContext,
- RelationGetRelationName(relation),
- ALLOCSET_SMALL_SIZES);
+ indexcxt = AllocSetContextCreateExtended(CacheMemoryContext,
+ RelationGetRelationName(relation),
+ MEMCONTEXT_COPY_NAME,
+ ALLOCSET_SMALL_SIZES);
relation->rd_indexcxt = indexcxt;
/*
@@ -5537,9 +5540,11 @@ load_relcache_init_file(bool shared)
* prepare index info context --- parameters should match
* RelationInitIndexAccessInfo
*/
- indexcxt = AllocSetContextCreate(CacheMemoryContext,
- RelationGetRelationName(rel),
- ALLOCSET_SMALL_SIZES);
+ indexcxt =
+ AllocSetContextCreateExtended(CacheMemoryContext,
+ RelationGetRelationName(rel),
+ MEMCONTEXT_COPY_NAME,
+ ALLOCSET_SMALL_SIZES);
rel->rd_indexcxt = indexcxt;
/*
diff --git a/src/backend/utils/cache/ts_cache.c b/src/backend/utils/cache/ts_cache.c
index da5c8ea345b..29cf93a4de6 100644
--- a/src/backend/utils/cache/ts_cache.c
+++ b/src/backend/utils/cache/ts_cache.c
@@ -294,9 +294,10 @@ lookup_ts_dictionary_cache(Oid dictId)
Assert(!found); /* it wasn't there a moment ago */
/* Create private memory context the first time through */
- saveCtx = AllocSetContextCreate(CacheMemoryContext,
- NameStr(dict->dictname),
- ALLOCSET_SMALL_SIZES);
+ saveCtx = AllocSetContextCreateExtended(CacheMemoryContext,
+ NameStr(dict->dictname),
+ MEMCONTEXT_COPY_NAME,
+ ALLOCSET_SMALL_SIZES);
}
else
{