Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit74811c4

Browse files
committed
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 oftype AllocSet, so rename it from "context" to "set".
1 parentb419865 commit74811c4

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

‎src/backend/utils/mmgr/aset.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -438,14 +438,14 @@ AllocSetContextCreate(MemoryContext parent,
438438
SizeinitBlockSize,
439439
SizemaxBlockSize)
440440
{
441-
AllocSetcontext;
441+
AllocSetset;
442442

443443
/* Do the type-independent part of context creation */
444-
context= (AllocSet)MemoryContextCreate(T_AllocSetContext,
445-
sizeof(AllocSetContext),
446-
&AllocSetMethods,
447-
parent,
448-
name);
444+
set= (AllocSet)MemoryContextCreate(T_AllocSetContext,
445+
sizeof(AllocSetContext),
446+
&AllocSetMethods,
447+
parent,
448+
name);
449449

450450
/*
451451
* Make sure alloc parameters are reasonable, and save them.
@@ -459,9 +459,9 @@ AllocSetContextCreate(MemoryContext parent,
459459
if (maxBlockSize<initBlockSize)
460460
maxBlockSize=initBlockSize;
461461
Assert(AllocHugeSizeIsValid(maxBlockSize));/* must be safe to double */
462-
context->initBlockSize=initBlockSize;
463-
context->maxBlockSize=maxBlockSize;
464-
context->nextBlockSize=initBlockSize;
462+
set->initBlockSize=initBlockSize;
463+
set->maxBlockSize=maxBlockSize;
464+
set->nextBlockSize=initBlockSize;
465465

466466
/*
467467
* Compute the allocation chunk size limit for this context. It can't be
@@ -477,10 +477,10 @@ AllocSetContextCreate(MemoryContext parent,
477477
* and actually-allocated sizes of any chunk must be on the same side of
478478
* the limit, else we get confused about whether the chunk is "big".
479479
*/
480-
context->allocChunkLimit=ALLOC_CHUNK_LIMIT;
481-
while ((Size) (context->allocChunkLimit+ALLOC_CHUNKHDRSZ)>
480+
set->allocChunkLimit=ALLOC_CHUNK_LIMIT;
481+
while ((Size) (set->allocChunkLimit+ALLOC_CHUNKHDRSZ)>
482482
(Size) ((maxBlockSize-ALLOC_BLOCKHDRSZ) /ALLOC_CHUNK_FRACTION))
483-
context->allocChunkLimit >>=1;
483+
set->allocChunkLimit >>=1;
484484

485485
/*
486486
* Grab always-allocated space, if requested
@@ -500,20 +500,20 @@ AllocSetContextCreate(MemoryContext parent,
500500
errdetail("Failed while creating memory context \"%s\".",
501501
name)));
502502
}
503-
block->aset=context;
503+
block->aset=set;
504504
block->freeptr= ((char*)block)+ALLOC_BLOCKHDRSZ;
505505
block->endptr= ((char*)block)+blksize;
506-
block->next=context->blocks;
507-
context->blocks=block;
506+
block->next=set->blocks;
507+
set->blocks=block;
508508
/* Mark block as not to be released at reset time */
509-
context->keeper=block;
509+
set->keeper=block;
510510

511511
/* Mark unallocated space NOACCESS; leave the block header alone. */
512512
VALGRIND_MAKE_MEM_NOACCESS(block->freeptr,
513513
blksize-ALLOC_BLOCKHDRSZ);
514514
}
515515

516-
return (MemoryContext)context;
516+
return (MemoryContext)set;
517517
}
518518

519519
/*

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp