summaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
authorJeff Davis2015-02-22 07:17:52 +0000
committerJeff Davis2015-02-22 07:17:52 +0000
commit74811c4050921959d54d42e2c15bb79f0e2c37f3 (patch)
treeb1c5faef9f97d089a2fb9d97788c7fa4f7a89a67 /src/backend
parentb419865a814abbca12bdd6eef6a3d5ed67f432e1 (diff)
Rename variable in AllocSetContextCreate to be consistent.
Everywhere else in the file, "context" is of type MemoryContext and "set" is of type AllocSet. AllocSetContextCreate uses a variable of type AllocSet, so rename it from "context" to "set".
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/mmgr/aset.c34
1 files changed, 17 insertions, 17 deletions
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c
index 0759e39ecb6..0cfb934b003 100644
--- a/src/backend/utils/mmgr/aset.c
+++ b/src/backend/utils/mmgr/aset.c
@@ -438,14 +438,14 @@ AllocSetContextCreate(MemoryContext parent,
Size initBlockSize,
Size maxBlockSize)
{
- AllocSet context;
+ AllocSet set;
/* Do the type-independent part of context creation */
- context = (AllocSet) MemoryContextCreate(T_AllocSetContext,
- sizeof(AllocSetContext),
- &AllocSetMethods,
- parent,
- name);
+ set = (AllocSet) MemoryContextCreate(T_AllocSetContext,
+ sizeof(AllocSetContext),
+ &AllocSetMethods,
+ parent,
+ name);
/*
* Make sure alloc parameters are reasonable, and save them.
@@ -459,9 +459,9 @@ AllocSetContextCreate(MemoryContext parent,
if (maxBlockSize < initBlockSize)
maxBlockSize = initBlockSize;
Assert(AllocHugeSizeIsValid(maxBlockSize)); /* must be safe to double */
- context->initBlockSize = initBlockSize;
- context->maxBlockSize = maxBlockSize;
- context->nextBlockSize = initBlockSize;
+ set->initBlockSize = initBlockSize;
+ set->maxBlockSize = maxBlockSize;
+ set->nextBlockSize = initBlockSize;
/*
* Compute the allocation chunk size limit for this context. It can't be
@@ -477,10 +477,10 @@ AllocSetContextCreate(MemoryContext parent,
* and actually-allocated sizes of any chunk must be on the same side of
* the limit, else we get confused about whether the chunk is "big".
*/
- context->allocChunkLimit = ALLOC_CHUNK_LIMIT;
- while ((Size) (context->allocChunkLimit + ALLOC_CHUNKHDRSZ) >
+ set->allocChunkLimit = ALLOC_CHUNK_LIMIT;
+ while ((Size) (set->allocChunkLimit + ALLOC_CHUNKHDRSZ) >
(Size) ((maxBlockSize - ALLOC_BLOCKHDRSZ) / ALLOC_CHUNK_FRACTION))
- context->allocChunkLimit >>= 1;
+ set->allocChunkLimit >>= 1;
/*
* Grab always-allocated space, if requested
@@ -500,20 +500,20 @@ AllocSetContextCreate(MemoryContext parent,
errdetail("Failed while creating memory context \"%s\".",
name)));
}
- block->aset = context;
+ block->aset = set;
block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ;
block->endptr = ((char *) block) + blksize;
- block->next = context->blocks;
- context->blocks = block;
+ block->next = set->blocks;
+ set->blocks = block;
/* Mark block as not to be released at reset time */
- context->keeper = block;
+ set->keeper = block;
/* Mark unallocated space NOACCESS; leave the block header alone. */
VALGRIND_MAKE_MEM_NOACCESS(block->freeptr,
blksize - ALLOC_BLOCKHDRSZ);
}
- return (MemoryContext) context;
+ return (MemoryContext) set;
}
/*