mirror of
				https://github.com/postgres/postgres.git
				synced 2025-11-03 00:08:23 -05:00 
			
		
		
		
	Rename MemoryContextCopySetIdentifier() for clarity
MemoryContextCopySetIdentifier -> MemoryContextCopyAndSetIdentifier Discussion: https://www.postgresql.org/message-id/6421.1522194949@sss.pgh.pa.us
This commit is contained in:
		
							parent
							
								
									cfbecf8100
								
							
						
					
					
						commit
						bbca77623f
					
				@ -528,7 +528,7 @@ RelationBuildPartitionDesc(Relation rel)
 | 
			
		||||
	rel->rd_pdcxt = AllocSetContextCreate(CacheMemoryContext,
 | 
			
		||||
										  "partition descriptor",
 | 
			
		||||
										  ALLOCSET_DEFAULT_SIZES);
 | 
			
		||||
	MemoryContextCopySetIdentifier(rel->rd_pdcxt, RelationGetRelationName(rel));
 | 
			
		||||
	MemoryContextCopyAndSetIdentifier(rel->rd_pdcxt, RelationGetRelationName(rel));
 | 
			
		||||
 | 
			
		||||
	oldcxt = MemoryContextSwitchTo(rel->rd_pdcxt);
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -214,7 +214,7 @@ RelationBuildRowSecurity(Relation relation)
 | 
			
		||||
		SysScanDesc sscan;
 | 
			
		||||
		HeapTuple	tuple;
 | 
			
		||||
 | 
			
		||||
		MemoryContextCopySetIdentifier(rscxt,
 | 
			
		||||
		MemoryContextCopyAndSetIdentifier(rscxt,
 | 
			
		||||
									   RelationGetRelationName(relation));
 | 
			
		||||
 | 
			
		||||
		rsdesc = MemoryContextAllocZero(rscxt, sizeof(RowSecurityDesc));
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										2
									
								
								src/backend/utils/cache/plancache.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								src/backend/utils/cache/plancache.c
									
									
									
									
										vendored
									
									
								
							@ -952,7 +952,7 @@ BuildCachedPlan(CachedPlanSource *plansource, List *qlist,
 | 
			
		||||
		plan_context = AllocSetContextCreate(CurrentMemoryContext,
 | 
			
		||||
											 "CachedPlan",
 | 
			
		||||
											 ALLOCSET_START_SMALL_SIZES);
 | 
			
		||||
		MemoryContextCopySetIdentifier(plan_context, plansource->query_string);
 | 
			
		||||
		MemoryContextCopyAndSetIdentifier(plan_context, plansource->query_string);
 | 
			
		||||
 | 
			
		||||
		/*
 | 
			
		||||
		 * Copy plan into the new context.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										8
									
								
								src/backend/utils/cache/relcache.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										8
									
								
								src/backend/utils/cache/relcache.c
									
									
									
									
										vendored
									
									
								
							@ -741,7 +741,7 @@ RelationBuildRuleLock(Relation relation)
 | 
			
		||||
									 "relation rules",
 | 
			
		||||
									 ALLOCSET_SMALL_SIZES);
 | 
			
		||||
	relation->rd_rulescxt = rulescxt;
 | 
			
		||||
	MemoryContextCopySetIdentifier(rulescxt,
 | 
			
		||||
	MemoryContextCopyAndSetIdentifier(rulescxt,
 | 
			
		||||
								   RelationGetRelationName(relation));
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
@ -918,7 +918,7 @@ RelationBuildPartitionKey(Relation relation)
 | 
			
		||||
	partkeycxt = AllocSetContextCreate(CurTransactionContext,
 | 
			
		||||
									   "partition key",
 | 
			
		||||
									   ALLOCSET_SMALL_SIZES);
 | 
			
		||||
	MemoryContextCopySetIdentifier(partkeycxt,
 | 
			
		||||
	MemoryContextCopyAndSetIdentifier(partkeycxt,
 | 
			
		||||
								   RelationGetRelationName(relation));
 | 
			
		||||
 | 
			
		||||
	key = (PartitionKey) MemoryContextAllocZero(partkeycxt,
 | 
			
		||||
@ -1601,7 +1601,7 @@ RelationInitIndexAccessInfo(Relation relation)
 | 
			
		||||
									 "index info",
 | 
			
		||||
									 ALLOCSET_SMALL_SIZES);
 | 
			
		||||
	relation->rd_indexcxt = indexcxt;
 | 
			
		||||
	MemoryContextCopySetIdentifier(indexcxt,
 | 
			
		||||
	MemoryContextCopyAndSetIdentifier(indexcxt,
 | 
			
		||||
								   RelationGetRelationName(relation));
 | 
			
		||||
 | 
			
		||||
	/*
 | 
			
		||||
@ -5668,7 +5668,7 @@ load_relcache_init_file(bool shared)
 | 
			
		||||
											 "index info",
 | 
			
		||||
											 ALLOCSET_SMALL_SIZES);
 | 
			
		||||
			rel->rd_indexcxt = indexcxt;
 | 
			
		||||
			MemoryContextCopySetIdentifier(indexcxt,
 | 
			
		||||
			MemoryContextCopyAndSetIdentifier(indexcxt,
 | 
			
		||||
										   RelationGetRelationName(rel));
 | 
			
		||||
 | 
			
		||||
			/*
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										4
									
								
								src/backend/utils/cache/ts_cache.c
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										4
									
								
								src/backend/utils/cache/ts_cache.c
									
									
									
									
										vendored
									
									
								
							@ -297,7 +297,7 @@ lookup_ts_dictionary_cache(Oid dictId)
 | 
			
		||||
			saveCtx = AllocSetContextCreate(CacheMemoryContext,
 | 
			
		||||
											"TS dictionary",
 | 
			
		||||
											ALLOCSET_SMALL_SIZES);
 | 
			
		||||
			MemoryContextCopySetIdentifier(saveCtx, NameStr(dict->dictname));
 | 
			
		||||
			MemoryContextCopyAndSetIdentifier(saveCtx, NameStr(dict->dictname));
 | 
			
		||||
		}
 | 
			
		||||
		else
 | 
			
		||||
		{
 | 
			
		||||
@ -306,7 +306,7 @@ lookup_ts_dictionary_cache(Oid dictId)
 | 
			
		||||
			/* Don't let context's ident pointer dangle while we reset it */
 | 
			
		||||
			MemoryContextSetIdentifier(saveCtx, NULL);
 | 
			
		||||
			MemoryContextReset(saveCtx);
 | 
			
		||||
			MemoryContextCopySetIdentifier(saveCtx, NameStr(dict->dictname));
 | 
			
		||||
			MemoryContextCopyAndSetIdentifier(saveCtx, NameStr(dict->dictname));
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
		MemSet(entry, 0, sizeof(TSDictionaryCacheEntry));
 | 
			
		||||
 | 
			
		||||
@ -93,7 +93,7 @@ extern void MemoryContextCheck(MemoryContext context);
 | 
			
		||||
extern bool MemoryContextContains(MemoryContext context, void *pointer);
 | 
			
		||||
 | 
			
		||||
/* Handy macro for copying and assigning context ID ... but note double eval */
 | 
			
		||||
#define MemoryContextCopySetIdentifier(cxt, id) \
 | 
			
		||||
#define MemoryContextCopyAndSetIdentifier(cxt, id) \
 | 
			
		||||
	MemoryContextSetIdentifier(cxt, MemoryContextStrdup(cxt, id))
 | 
			
		||||
 | 
			
		||||
/*
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user