mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
pgindent run over code.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.15 1999/05/22 23:19:37 tgl Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/aset.c,v 1.16 1999/05/25 16:12:51 momjian Exp $
|
||||
*
|
||||
* NOTE:
|
||||
* This is a new (Feb. 05, 1999) implementation of the allocation set
|
||||
@@ -51,7 +51,7 @@
|
||||
*/
|
||||
|
||||
#define ALLOC_MINBITS 4 /* smallest chunk size is 16 bytes */
|
||||
#define ALLOC_SMALLCHUNK_LIMIT (1 << (ALLOCSET_NUM_FREELISTS-2+ALLOC_MINBITS))
|
||||
#define ALLOC_SMALLCHUNK_LIMIT (1 << (ALLOCSET_NUM_FREELISTS-2+ALLOC_MINBITS))
|
||||
/* Size of largest chunk that we use a fixed size for */
|
||||
|
||||
/*--------------------
|
||||
@@ -65,8 +65,8 @@
|
||||
*--------------------
|
||||
*/
|
||||
|
||||
#define ALLOC_MIN_BLOCK_SIZE 8192
|
||||
#define ALLOC_MAX_BLOCK_SIZE (8 * 1024 * 1024)
|
||||
#define ALLOC_MIN_BLOCK_SIZE 8192
|
||||
#define ALLOC_MAX_BLOCK_SIZE (8 * 1024 * 1024)
|
||||
|
||||
|
||||
#define ALLOC_BLOCKHDRSZ MAXALIGN(sizeof(AllocBlockData))
|
||||
@@ -91,12 +91,12 @@
|
||||
static inline int
|
||||
AllocSetFreeIndex(Size size)
|
||||
{
|
||||
int idx = 0;
|
||||
int idx = 0;
|
||||
|
||||
if (size > 0)
|
||||
{
|
||||
size = (size - 1) >> ALLOC_MINBITS;
|
||||
while (size != 0 && idx < ALLOCSET_NUM_FREELISTS-1)
|
||||
while (size != 0 && idx < ALLOCSET_NUM_FREELISTS - 1)
|
||||
{
|
||||
idx++;
|
||||
size >>= 1;
|
||||
@@ -105,7 +105,7 @@ AllocSetFreeIndex(Size size)
|
||||
|
||||
return idx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Public routines
|
||||
@@ -119,7 +119,7 @@ AllocSetFreeIndex(Size size)
|
||||
*/
|
||||
|
||||
/*
|
||||
* AllocSetInit
|
||||
* AllocSetInit
|
||||
* Initializes given allocation set.
|
||||
*
|
||||
* Note:
|
||||
@@ -147,7 +147,7 @@ AllocSetInit(AllocSet set, AllocMode mode, Size limit)
|
||||
|
||||
|
||||
/*
|
||||
* AllocSetReset
|
||||
* AllocSetReset
|
||||
* Frees memory which is allocated in the given set.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -156,8 +156,8 @@ AllocSetInit(AllocSet set, AllocMode mode, Size limit)
|
||||
void
|
||||
AllocSetReset(AllocSet set)
|
||||
{
|
||||
AllocBlock block = set->blocks;
|
||||
AllocBlock next;
|
||||
AllocBlock block = set->blocks;
|
||||
AllocBlock next;
|
||||
|
||||
AssertArg(AllocSetIsValid(set));
|
||||
|
||||
@@ -172,7 +172,7 @@ AllocSetReset(AllocSet set)
|
||||
}
|
||||
|
||||
/*
|
||||
* AllocSetContains
|
||||
* AllocSetContains
|
||||
* True iff allocation set contains given allocation element.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -189,7 +189,7 @@ AllocSetContains(AllocSet set, AllocPointer pointer)
|
||||
}
|
||||
|
||||
/*
|
||||
* AllocSetAlloc
|
||||
* AllocSetAlloc
|
||||
* Returns pointer to allocated memory of given size; memory is added
|
||||
* to the set.
|
||||
*
|
||||
@@ -200,22 +200,22 @@ AllocSetContains(AllocSet set, AllocPointer pointer)
|
||||
AllocPointer
|
||||
AllocSetAlloc(AllocSet set, Size size)
|
||||
{
|
||||
AllocBlock block;
|
||||
AllocChunk chunk;
|
||||
AllocChunk freeref = NULL;
|
||||
int fidx;
|
||||
Size chunk_size;
|
||||
Size blksize;
|
||||
AllocBlock block;
|
||||
AllocChunk chunk;
|
||||
AllocChunk freeref = NULL;
|
||||
int fidx;
|
||||
Size chunk_size;
|
||||
Size blksize;
|
||||
|
||||
AssertArg(AllocSetIsValid(set));
|
||||
|
||||
/*
|
||||
* Lookup in the corresponding free list if there is a
|
||||
* free chunk we could reuse
|
||||
* Lookup in the corresponding free list if there is a free chunk we
|
||||
* could reuse
|
||||
*
|
||||
*/
|
||||
fidx = AllocSetFreeIndex(size);
|
||||
for (chunk = set->freelist[fidx]; chunk; chunk = (AllocChunk)chunk->aset)
|
||||
for (chunk = set->freelist[fidx]; chunk; chunk = (AllocChunk) chunk->aset)
|
||||
{
|
||||
if (chunk->size >= size)
|
||||
break;
|
||||
@@ -223,18 +223,18 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* If one is found, remove it from the free list, make it again
|
||||
* a member of the alloc set and return it's data address.
|
||||
* If one is found, remove it from the free list, make it again a
|
||||
* member of the alloc set and return it's data address.
|
||||
*
|
||||
*/
|
||||
if (chunk != NULL)
|
||||
{
|
||||
if (freeref == NULL)
|
||||
set->freelist[fidx] = (AllocChunk)chunk->aset;
|
||||
set->freelist[fidx] = (AllocChunk) chunk->aset;
|
||||
else
|
||||
freeref->aset = chunk->aset;
|
||||
|
||||
chunk->aset = (void *)set;
|
||||
chunk->aset = (void *) set;
|
||||
return AllocChunkGetPointer(chunk);
|
||||
}
|
||||
|
||||
@@ -248,8 +248,8 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
Assert(chunk_size >= size);
|
||||
|
||||
/*
|
||||
* If there is enough room in the active allocation block,
|
||||
* always allocate the chunk there.
|
||||
* If there is enough room in the active allocation block, always
|
||||
* allocate the chunk there.
|
||||
*/
|
||||
|
||||
if ((block = set->blocks) != NULL)
|
||||
@@ -261,8 +261,8 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* Otherwise, if requested size exceeds smallchunk limit,
|
||||
* allocate an entire separate block for this allocation
|
||||
* Otherwise, if requested size exceeds smallchunk limit, allocate an
|
||||
* entire separate block for this allocation
|
||||
*
|
||||
*/
|
||||
if (block == NULL && size > ALLOC_SMALLCHUNK_LIMIT)
|
||||
@@ -272,9 +272,9 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
if (block == NULL)
|
||||
elog(FATAL, "Memory exhausted in AllocSetAlloc()");
|
||||
block->aset = set;
|
||||
block->freeptr = block->endptr = ((char *)block) + blksize;
|
||||
block->freeptr = block->endptr = ((char *) block) + blksize;
|
||||
|
||||
chunk = (AllocChunk) (((char *)block) + ALLOC_BLOCKHDRSZ);
|
||||
chunk = (AllocChunk) (((char *) block) + ALLOC_BLOCKHDRSZ);
|
||||
chunk->aset = set;
|
||||
chunk->size = chunk_size;
|
||||
|
||||
@@ -310,8 +310,11 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
{
|
||||
/* Get size of prior block */
|
||||
blksize = set->blocks->endptr - ((char *) set->blocks);
|
||||
/* Special case: if very first allocation was for a large chunk,
|
||||
* could have a funny-sized top block. Do something reasonable.
|
||||
|
||||
/*
|
||||
* Special case: if very first allocation was for a large
|
||||
* chunk, could have a funny-sized top block. Do something
|
||||
* reasonable.
|
||||
*/
|
||||
if (blksize < ALLOC_MIN_BLOCK_SIZE)
|
||||
blksize = ALLOC_MIN_BLOCK_SIZE;
|
||||
@@ -321,12 +324,13 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
blksize = ALLOC_MAX_BLOCK_SIZE;
|
||||
/* Try to allocate it */
|
||||
block = (AllocBlock) malloc(blksize);
|
||||
|
||||
/*
|
||||
* We could be asking for pretty big blocks here, so cope if
|
||||
* malloc fails. But give up if there's less than a meg or so
|
||||
* available...
|
||||
*/
|
||||
while (block == NULL && blksize > 1024*1024)
|
||||
while (block == NULL && blksize > 1024 * 1024)
|
||||
{
|
||||
blksize >>= 1;
|
||||
block = (AllocBlock) malloc(blksize);
|
||||
@@ -336,8 +340,8 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
if (block == NULL)
|
||||
elog(FATAL, "Memory exhausted in AllocSetAlloc()");
|
||||
block->aset = set;
|
||||
block->freeptr = ((char *)block) + ALLOC_BLOCKHDRSZ;
|
||||
block->endptr = ((char *)block) + blksize;
|
||||
block->freeptr = ((char *) block) + ALLOC_BLOCKHDRSZ;
|
||||
block->endptr = ((char *) block) + blksize;
|
||||
block->next = set->blocks;
|
||||
|
||||
set->blocks = block;
|
||||
@@ -346,8 +350,8 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
/*
|
||||
* OK, do the allocation
|
||||
*/
|
||||
chunk = (AllocChunk)(block->freeptr);
|
||||
chunk->aset = (void *)set;
|
||||
chunk = (AllocChunk) (block->freeptr);
|
||||
chunk->aset = (void *) set;
|
||||
chunk->size = chunk_size;
|
||||
block->freeptr += (chunk_size + ALLOC_CHUNKHDRSZ);
|
||||
Assert(block->freeptr <= block->endptr);
|
||||
@@ -356,7 +360,7 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* AllocSetFree
|
||||
* AllocSetFree
|
||||
* Frees allocated memory; memory is removed from the set.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -367,8 +371,8 @@ AllocSetAlloc(AllocSet set, Size size)
|
||||
void
|
||||
AllocSetFree(AllocSet set, AllocPointer pointer)
|
||||
{
|
||||
int fidx;
|
||||
AllocChunk chunk;
|
||||
int fidx;
|
||||
AllocChunk chunk;
|
||||
|
||||
/* AssertArg(AllocSetIsValid(set)); */
|
||||
/* AssertArg(AllocPointerIsValid(pointer)); */
|
||||
@@ -377,12 +381,12 @@ AllocSetFree(AllocSet set, AllocPointer pointer)
|
||||
chunk = AllocPointerGetChunk(pointer);
|
||||
fidx = AllocSetFreeIndex(chunk->size);
|
||||
|
||||
chunk->aset = (void *)set->freelist[fidx];
|
||||
chunk->aset = (void *) set->freelist[fidx];
|
||||
set->freelist[fidx] = chunk;
|
||||
}
|
||||
|
||||
/*
|
||||
* AllocSetRealloc
|
||||
* AllocSetRealloc
|
||||
* Returns new pointer to allocated memory of given size; this memory
|
||||
* is added to the set. Memory associated with given pointer is copied
|
||||
* into the new memory, and the old memory is freed.
|
||||
@@ -404,8 +408,8 @@ AllocSetRealloc(AllocSet set, AllocPointer pointer, Size size)
|
||||
AssertArg(AllocSetContains(set, pointer));
|
||||
|
||||
/*
|
||||
* Chunk sizes are aligned to power of 2 on AllocSetAlloc().
|
||||
* Maybe the allocated area already is >= the new size.
|
||||
* Chunk sizes are aligned to power of 2 on AllocSetAlloc(). Maybe the
|
||||
* allocated area already is >= the new size.
|
||||
*
|
||||
*/
|
||||
oldsize = AllocPointerGetSize(pointer);
|
||||
@@ -425,7 +429,7 @@ AllocSetRealloc(AllocSet set, AllocPointer pointer, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* AllocSetDump
|
||||
* AllocSetDump
|
||||
* Displays allocated set.
|
||||
*/
|
||||
void
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.13 1999/03/22 16:45:27 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/mcxt.c,v 1.14 1999/05/25 16:12:53 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -54,7 +54,7 @@ static OrderedSetData ActiveGlobalMemorySetData; /* uninitialized */
|
||||
#define PSIZESPACE(LEN) ((LEN) + sizeof (int32))
|
||||
|
||||
/*
|
||||
* AllocSizeIsValid
|
||||
* AllocSizeIsValid
|
||||
* True iff 0 < size and size <= MaxAllocSize.
|
||||
*/
|
||||
#define AllocSizeIsValid(size) (0 < (size) && (size) <= MaxAllocSize)
|
||||
@@ -64,7 +64,7 @@ static OrderedSetData ActiveGlobalMemorySetData; /* uninitialized */
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* CurrentMemoryContext
|
||||
* CurrentMemoryContext
|
||||
* Memory context for general global allocations.
|
||||
*/
|
||||
DLLIMPORT MemoryContext CurrentMemoryContext = NULL;
|
||||
@@ -106,14 +106,14 @@ static struct MemoryContextMethodsData GlobalContextMethodsData = {
|
||||
static struct GlobalMemoryData TopGlobalMemoryData = {
|
||||
T_GlobalMemory, /* NodeTag tag */
|
||||
&GlobalContextMethodsData, /* ContextMethods method */
|
||||
{ NULL, { NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL }},
|
||||
/* free AllocSet */
|
||||
{NULL, {NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL}},
|
||||
/* free AllocSet */
|
||||
"TopGlobal", /* char* name */
|
||||
{0} /* uninitialized OrderedElemData elemD */
|
||||
};
|
||||
|
||||
/*
|
||||
* TopMemoryContext
|
||||
* TopMemoryContext
|
||||
* Memory context for general global allocations.
|
||||
*
|
||||
* Note:
|
||||
@@ -131,7 +131,7 @@ MemoryContext TopMemoryContext = (MemoryContext) &TopGlobalMemoryData;
|
||||
*/
|
||||
|
||||
/*
|
||||
* EnableMemoryContext
|
||||
* EnableMemoryContext
|
||||
* Enables/disables memory management and global contexts.
|
||||
*
|
||||
* Note:
|
||||
@@ -207,7 +207,7 @@ EnableMemoryContext(bool on)
|
||||
}
|
||||
|
||||
/*
|
||||
* MemoryContextAlloc
|
||||
* MemoryContextAlloc
|
||||
* Returns pointer to aligned allocated memory in the given context.
|
||||
*
|
||||
* Note:
|
||||
@@ -231,7 +231,7 @@ MemoryContextAlloc(MemoryContext context, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* MemoryContextFree
|
||||
* MemoryContextFree
|
||||
* Frees allocated memory referenced by pointer in the given context.
|
||||
*
|
||||
* Note:
|
||||
@@ -252,7 +252,7 @@ MemoryContextFree(MemoryContext context, Pointer pointer)
|
||||
}
|
||||
|
||||
/*
|
||||
* MemoryContextRelloc
|
||||
* MemoryContextRelloc
|
||||
* Returns pointer to aligned allocated memory in the given context.
|
||||
*
|
||||
* Note:
|
||||
@@ -278,7 +278,7 @@ MemoryContextRealloc(MemoryContext context,
|
||||
}
|
||||
|
||||
/*
|
||||
* MemoryContextGetName
|
||||
* MemoryContextGetName
|
||||
* Returns pointer to aligned allocated memory in the given context.
|
||||
*
|
||||
* Note:
|
||||
@@ -301,7 +301,7 @@ MemoryContextGetName(MemoryContext context)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PointerGetAllocSize
|
||||
* PointerGetAllocSize
|
||||
* Returns size of aligned allocated memory given pointer to it.
|
||||
*
|
||||
* Note:
|
||||
@@ -324,7 +324,7 @@ PointerGetAllocSize(Pointer pointer)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* MemoryContextSwitchTo
|
||||
* MemoryContextSwitchTo
|
||||
* Returns the current context; installs the given context.
|
||||
*
|
||||
* Note:
|
||||
@@ -351,7 +351,7 @@ MemoryContextSwitchTo(MemoryContext context)
|
||||
* External Functions
|
||||
*/
|
||||
/*
|
||||
* CreateGlobalMemory
|
||||
* CreateGlobalMemory
|
||||
* Returns new global memory context.
|
||||
*
|
||||
* Note:
|
||||
@@ -385,7 +385,7 @@ CreateGlobalMemory(char *name) /* XXX MemoryContextName */
|
||||
}
|
||||
|
||||
/*
|
||||
* GlobalMemoryDestroy
|
||||
* GlobalMemoryDestroy
|
||||
* Destroys given global memory context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -413,7 +413,7 @@ GlobalMemoryDestroy(GlobalMemory context)
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* GlobalMemoryAlloc
|
||||
* GlobalMemoryAlloc
|
||||
* Returns pointer to aligned space in the global context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -426,7 +426,7 @@ GlobalMemoryAlloc(GlobalMemory this, Size size)
|
||||
}
|
||||
|
||||
/*
|
||||
* GlobalMemoryFree
|
||||
* GlobalMemoryFree
|
||||
* Frees allocated memory in the global context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -441,7 +441,7 @@ GlobalMemoryFree(GlobalMemory this,
|
||||
}
|
||||
|
||||
/*
|
||||
* GlobalMemoryRealloc
|
||||
* GlobalMemoryRealloc
|
||||
* Returns pointer to aligned space in the global context.
|
||||
*
|
||||
* Note:
|
||||
@@ -461,7 +461,7 @@ GlobalMemoryRealloc(GlobalMemory this,
|
||||
}
|
||||
|
||||
/*
|
||||
* GlobalMemoryGetName
|
||||
* GlobalMemoryGetName
|
||||
* Returns name string for context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -474,7 +474,7 @@ GlobalMemoryGetName(GlobalMemory this)
|
||||
}
|
||||
|
||||
/*
|
||||
* GlobalMemoryDump
|
||||
* GlobalMemoryDump
|
||||
* Dumps global memory context for debugging.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -499,7 +499,7 @@ GlobalMemoryDump(GlobalMemory this)
|
||||
}
|
||||
|
||||
/*
|
||||
* DumpGlobalMemories
|
||||
* DumpGlobalMemories
|
||||
* Dumps all global memory contexts for debugging.
|
||||
*
|
||||
* Exceptions:
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.11 1999/02/13 23:20:10 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/oset.c,v 1.12 1999/05/25 16:12:54 momjian Exp $
|
||||
*
|
||||
* NOTE
|
||||
* XXX This is a preliminary implementation which lacks fail-fast
|
||||
@@ -24,7 +24,7 @@ static void OrderedElemPush(OrderedElem elem);
|
||||
static void OrderedElemPushHead(OrderedElem elem);
|
||||
|
||||
/*
|
||||
* OrderedElemGetBase
|
||||
* OrderedElemGetBase
|
||||
* Returns base of enclosing structure.
|
||||
*/
|
||||
static Pointer
|
||||
@@ -37,7 +37,7 @@ OrderedElemGetBase(OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedSetInit
|
||||
* OrderedSetInit
|
||||
*/
|
||||
void
|
||||
OrderedSetInit(OrderedSet set, Offset offset)
|
||||
@@ -49,7 +49,7 @@ OrderedSetInit(OrderedSet set, Offset offset)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedSetContains
|
||||
* OrderedSetContains
|
||||
* True iff ordered set contains given element.
|
||||
*/
|
||||
bool
|
||||
@@ -59,7 +59,7 @@ OrderedSetContains(OrderedSet set, OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedSetGetHead
|
||||
* OrderedSetGetHead
|
||||
*/
|
||||
Pointer
|
||||
OrderedSetGetHead(OrderedSet set)
|
||||
@@ -73,7 +73,7 @@ OrderedSetGetHead(OrderedSet set)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedSetGetTail
|
||||
* OrderedSetGetTail
|
||||
*/
|
||||
#ifdef NOT_USED
|
||||
Pointer
|
||||
@@ -90,7 +90,7 @@ OrderedSetGetTail(OrderedSet set)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* OrderedElemGetPredecessor
|
||||
* OrderedElemGetPredecessor
|
||||
*/
|
||||
Pointer
|
||||
OrderedElemGetPredecessor(OrderedElem elem)
|
||||
@@ -102,7 +102,7 @@ OrderedElemGetPredecessor(OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemGetSuccessor
|
||||
* OrderedElemGetSuccessor
|
||||
*/
|
||||
Pointer
|
||||
OrderedElemGetSuccessor(OrderedElem elem)
|
||||
@@ -114,7 +114,7 @@ OrderedElemGetSuccessor(OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemPop
|
||||
* OrderedElemPop
|
||||
*/
|
||||
void
|
||||
OrderedElemPop(OrderedElem elem)
|
||||
@@ -127,7 +127,7 @@ OrderedElemPop(OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemPushInto
|
||||
* OrderedElemPushInto
|
||||
*/
|
||||
void
|
||||
OrderedElemPushInto(OrderedElem elem, OrderedSet set)
|
||||
@@ -140,7 +140,7 @@ OrderedElemPushInto(OrderedElem elem, OrderedSet set)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemPush
|
||||
* OrderedElemPush
|
||||
*/
|
||||
static void
|
||||
OrderedElemPush(OrderedElem elem)
|
||||
@@ -149,7 +149,7 @@ OrderedElemPush(OrderedElem elem)
|
||||
}
|
||||
|
||||
/*
|
||||
* OrderedElemPushHead
|
||||
* OrderedElemPushHead
|
||||
*/
|
||||
static void
|
||||
OrderedElemPushHead(OrderedElem elem)
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/palloc.c,v 1.11 1999/02/13 23:20:11 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/Attic/palloc.c,v 1.12 1999/05/25 16:12:54 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -36,7 +36,7 @@
|
||||
char *
|
||||
pstrdup(char *string)
|
||||
{
|
||||
char *nstr;
|
||||
char *nstr;
|
||||
int len;
|
||||
|
||||
nstr = palloc(len = strlen(string) + 1);
|
||||
@@ -44,4 +44,3 @@ pstrdup(char *string)
|
||||
|
||||
return nstr;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
*
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.18 1999/02/13 23:20:12 momjian Exp $
|
||||
* $Header: /cvsroot/pgsql/src/backend/utils/mmgr/portalmem.c,v 1.19 1999/05/25 16:12:55 momjian Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -50,7 +50,7 @@
|
||||
*
|
||||
* Here is an old comment taken from nodes/memnodes.h
|
||||
*
|
||||
* MemoryContext
|
||||
* MemoryContext
|
||||
* A logical context in which memory allocations occur.
|
||||
*
|
||||
* The types of memory contexts can be thought of as members of the
|
||||
@@ -517,7 +517,7 @@ DumpPortals()
|
||||
* ----------------------------------------------------------------
|
||||
*/
|
||||
/*
|
||||
* EnablePortalManager
|
||||
* EnablePortalManager
|
||||
* Enables/disables the portal management module.
|
||||
*/
|
||||
void
|
||||
@@ -579,7 +579,7 @@ EnablePortalManager(bool on)
|
||||
}
|
||||
|
||||
/*
|
||||
* GetPortalByName
|
||||
* GetPortalByName
|
||||
* Returns a portal given a portal name; returns blank portal given
|
||||
* NULL; returns invalid portal if portal not found.
|
||||
*
|
||||
@@ -606,7 +606,7 @@ GetPortalByName(char *name)
|
||||
}
|
||||
|
||||
/*
|
||||
* BlankPortalAssignName
|
||||
* BlankPortalAssignName
|
||||
* Returns former blank portal as portal with given name.
|
||||
*
|
||||
* Side effect:
|
||||
@@ -659,7 +659,7 @@ BlankPortalAssignName(char *name) /* XXX PortalName */
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalSetQuery
|
||||
* PortalSetQuery
|
||||
* Attaches a "query" to portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -686,7 +686,7 @@ PortalSetQuery(Portal portal,
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalGetQueryDesc
|
||||
* PortalGetQueryDesc
|
||||
* Returns query attached to portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -703,7 +703,7 @@ PortalGetQueryDesc(Portal portal)
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalGetState
|
||||
* PortalGetState
|
||||
* Returns state attached to portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -720,7 +720,7 @@ PortalGetState(Portal portal)
|
||||
}
|
||||
|
||||
/*
|
||||
* CreatePortal
|
||||
* CreatePortal
|
||||
* Returns a new portal given a name.
|
||||
*
|
||||
* Note:
|
||||
@@ -784,7 +784,7 @@ CreatePortal(char *name) /* XXX PortalName */
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalDestroy
|
||||
* PortalDestroy
|
||||
* Destroys portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -813,22 +813,22 @@ PortalDestroy(Portal *portalP)
|
||||
AllocSetReset(&portal->variable.setData); /* XXX log */
|
||||
|
||||
/*
|
||||
* In the case of a transaction abort it is possible that
|
||||
* we get called while one of the memory contexts of the portal
|
||||
* we're destroying is the current memory context.
|
||||
*
|
||||
* Don't know how to handle that cleanly because it is required
|
||||
* to be in that context right now. This portal struct remains
|
||||
* allocated in the PortalMemory context until backend dies.
|
||||
* In the case of a transaction abort it is possible that we get
|
||||
* called while one of the memory contexts of the portal we're
|
||||
* destroying is the current memory context.
|
||||
*
|
||||
* Not happy with that, but it's better to loose some bytes of
|
||||
* memory than to have the backend dump core.
|
||||
* Don't know how to handle that cleanly because it is required to be in
|
||||
* that context right now. This portal struct remains allocated in the
|
||||
* PortalMemory context until backend dies.
|
||||
*
|
||||
* Not happy with that, but it's better to loose some bytes of memory
|
||||
* than to have the backend dump core.
|
||||
*
|
||||
* --- Feb. 04, 1999 Jan Wieck
|
||||
*/
|
||||
if (CurrentMemoryContext == (MemoryContext)PortalGetHeapMemory(portal))
|
||||
if (CurrentMemoryContext == (MemoryContext) PortalGetHeapMemory(portal))
|
||||
return;
|
||||
if (CurrentMemoryContext == (MemoryContext)PortalGetVariableMemory(portal))
|
||||
if (CurrentMemoryContext == (MemoryContext) PortalGetVariableMemory(portal))
|
||||
return;
|
||||
|
||||
if (portal != BlankPortal)
|
||||
@@ -836,7 +836,7 @@ PortalDestroy(Portal *portalP)
|
||||
}
|
||||
|
||||
/* ----------------
|
||||
* PortalResetHeapMemory
|
||||
* PortalResetHeapMemory
|
||||
* Resets portal's heap memory context.
|
||||
*
|
||||
* Someday, Reset, Start, and End can be optimized by keeping a global
|
||||
@@ -873,7 +873,7 @@ PortalResetHeapMemory(Portal portal)
|
||||
}
|
||||
|
||||
/*
|
||||
* StartPortalAllocMode
|
||||
* StartPortalAllocMode
|
||||
* Starts a new block of portal heap allocation using mode and limit;
|
||||
* the current block is disabled until EndPortalAllocMode is called.
|
||||
*
|
||||
@@ -904,7 +904,7 @@ StartPortalAllocMode(AllocMode mode, Size limit)
|
||||
/* allocate and initialize new block */
|
||||
context->block = MemoryContextAlloc(
|
||||
(MemoryContext) PortalHeapMemoryGetVariableMemory(context),
|
||||
sizeof(HeapMemoryBlockData));
|
||||
sizeof(HeapMemoryBlockData));
|
||||
|
||||
/* XXX careful, context->block has never been stacked => bad state */
|
||||
|
||||
@@ -912,7 +912,7 @@ StartPortalAllocMode(AllocMode mode, Size limit)
|
||||
}
|
||||
|
||||
/*
|
||||
* EndPortalAllocMode
|
||||
* EndPortalAllocMode
|
||||
* Ends current block of portal heap allocation; previous block is
|
||||
* reenabled.
|
||||
*
|
||||
@@ -944,7 +944,7 @@ EndPortalAllocMode()
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalGetVariableMemory
|
||||
* PortalGetVariableMemory
|
||||
* Returns variable memory context for a given portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -958,7 +958,7 @@ PortalGetVariableMemory(Portal portal)
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalGetHeapMemory
|
||||
* PortalGetHeapMemory
|
||||
* Returns heap memory context for a given portal.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -972,7 +972,7 @@ PortalGetHeapMemory(Portal portal)
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalVariableMemoryGetPortal
|
||||
* PortalVariableMemoryGetPortal
|
||||
* Returns portal containing given variable memory context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -986,7 +986,7 @@ PortalVariableMemoryGetPortal(PortalVariableMemory context)
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalHeapMemoryGetPortal
|
||||
* PortalHeapMemoryGetPortal
|
||||
* Returns portal containing given heap memory context.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -1000,7 +1000,7 @@ PortalHeapMemoryGetPortal(PortalHeapMemory context)
|
||||
}
|
||||
|
||||
/*
|
||||
* PortalVariableMemoryGetHeapMemory
|
||||
* PortalVariableMemoryGetHeapMemory
|
||||
* Returns heap memory context associated with given variable memory.
|
||||
*
|
||||
* Exceptions:
|
||||
@@ -1019,7 +1019,7 @@ PortalVariableMemoryGetHeapMemory(PortalVariableMemory context)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* PortalHeapMemoryGetVariableMemory
|
||||
* PortalHeapMemoryGetVariableMemory
|
||||
* Returns variable memory context associated with given heap memory.
|
||||
*
|
||||
* Exceptions:
|
||||
|
||||
Reference in New Issue
Block a user