diff options
| author | Bruce Momjian <bruce@momjian.us> | 2007-11-15 21:14:46 +0000 |
|---|---|---|
| committer | Bruce Momjian <bruce@momjian.us> | 2007-11-15 21:14:46 +0000 |
| commit | fdf5a5efb7b28c13085fe7313658de8d7b9914f6 (patch) | |
| tree | a75cf1422fa1eef4e801cf502b148d8ce1b5dfe7 /src/backend/utils/mmgr | |
| parent | 3adc760fb92eab1a8720337a8bf9b66486609eb3 (diff) | |
| download | postgresql-fdf5a5efb7b28c13085fe7313658de8d7b9914f6.tar.gz | |
pgindent run for 8.3.
Diffstat (limited to 'src/backend/utils/mmgr')
| -rw-r--r-- | src/backend/utils/mmgr/aset.c | 22 | ||||
| -rw-r--r-- | src/backend/utils/mmgr/portalmem.c | 17 |
2 files changed, 20 insertions, 19 deletions
diff --git a/src/backend/utils/mmgr/aset.c b/src/backend/utils/mmgr/aset.c index 7d080af86d..d1848854cf 100644 --- a/src/backend/utils/mmgr/aset.c +++ b/src/backend/utils/mmgr/aset.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mmgr/aset.c,v 1.74 2007/08/12 20:39:14 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mmgr/aset.c,v 1.75 2007/11/15 21:14:41 momjian Exp $ * * NOTE: * This is a new (Feb. 05, 1999) implementation of the allocation set @@ -330,13 +330,13 @@ AllocSetContextCreate(MemoryContext parent, context->nextBlockSize = initBlockSize; /* - * Compute the allocation chunk size limit for this context. It can't - * be more than ALLOC_CHUNK_LIMIT because of the fixed number of - * freelists. If maxBlockSize is small then requests exceeding the - * maxBlockSize should be treated as large chunks, too. We have to - * have allocChunkLimit a power of two, because the requested 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". + * Compute the allocation chunk size limit for this context. It can't be + * more than ALLOC_CHUNK_LIMIT because of the fixed number of freelists. + * If maxBlockSize is small then requests exceeding the maxBlockSize + * should be treated as large chunks, too. We have to have + * allocChunkLimit a power of two, because the requested 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 (context->allocChunkLimit > @@ -935,9 +935,9 @@ AllocSetRealloc(MemoryContext context, void *pointer, Size size) * Small-chunk case. We just do this by brute force, ie, allocate a * new chunk and copy the data. Since we know the existing data isn't * huge, this won't involve any great memcpy expense, so it's not - * worth being smarter. (At one time we tried to avoid memcpy when - * it was possible to enlarge the chunk in-place, but that turns out - * to misbehave unpleasantly for repeated cycles of + * worth being smarter. (At one time we tried to avoid memcpy when it + * was possible to enlarge the chunk in-place, but that turns out to + * misbehave unpleasantly for repeated cycles of * palloc/repalloc/pfree: the eventually freed chunks go into the * wrong freelist for the next initial palloc request, and so we leak * memory indefinitely. See pgsql-hackers archives for 2007-08-11.) diff --git a/src/backend/utils/mmgr/portalmem.c b/src/backend/utils/mmgr/portalmem.c index 412e41952c..676012e329 100644 --- a/src/backend/utils/mmgr/portalmem.c +++ b/src/backend/utils/mmgr/portalmem.c @@ -12,7 +12,7 @@ * Portions Copyright (c) 1994, Regents of the University of California * * IDENTIFICATION - * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.103 2007/04/26 23:24:44 tgl Exp $ + * $PostgreSQL: pgsql/src/backend/utils/mmgr/portalmem.c,v 1.104 2007/11/15 21:14:41 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -161,7 +161,7 @@ PortalListGetPrimaryStmt(List *stmts) foreach(lc, stmts) { - Node *stmt = (Node *) lfirst(lc); + Node *stmt = (Node *) lfirst(lc); if (IsA(stmt, PlannedStmt)) { @@ -292,16 +292,16 @@ PortalDefineQuery(Portal portal, const char *sourceText, const char *commandTag, List *stmts, - CachedPlan *cplan) + CachedPlan * cplan) { AssertArg(PortalIsValid(portal)); AssertState(portal->status == PORTAL_NEW); Assert(commandTag != NULL || stmts == NIL); - portal->prepStmtName = prepStmtName ? + portal->prepStmtName = prepStmtName ? MemoryContextStrdup(PortalGetHeapMemory(portal), prepStmtName) : NULL; - portal->sourceText = sourceText ? + portal->sourceText = sourceText ? MemoryContextStrdup(PortalGetHeapMemory(portal), sourceText) : NULL; portal->commandTag = commandTag; portal->stmts = stmts; @@ -468,7 +468,8 @@ PortalHashTableDeleteAll(void) hash_seq_init(&status, PortalHashTable); while ((hentry = hash_seq_search(&status)) != NULL) { - Portal portal = hentry->portal; + Portal portal = hentry->portal; + if (portal->status != PORTAL_ACTIVE) PortalDrop(portal, false); } @@ -883,8 +884,8 @@ pg_cursor(PG_FUNCTION_ARGS) oldcontext = MemoryContextSwitchTo(per_query_ctx); /* - * build tupdesc for result tuples. This must match the definition of - * the pg_cursors view in system_views.sql + * build tupdesc for result tuples. This must match the definition of the + * pg_cursors view in system_views.sql */ tupdesc = CreateTemplateTupleDesc(6, false); TupleDescInitEntry(tupdesc, (AttrNumber) 1, "name", |
