1
0
mirror of https://github.com/postgres/postgres.git synced 2025-09-08 00:47:37 +03:00

Pull up isReset flag from AllocSetContext to MemoryContext struct. This

avoids the overhead of one function call when calling MemoryContextReset(),
and it seems like the isReset optimization would be applicable to any new
memory context we might invent in the future anyway.

This buys back the overhead I just added in previous patch to always call
MemoryContextReset() in ExecScan, even when there's no quals or projections.
This commit is contained in:
Heikki Linnakangas
2011-05-21 14:47:19 -04:00
parent 0319da638f
commit 30e98a7e6e
3 changed files with 19 additions and 25 deletions

View File

@@ -59,6 +59,7 @@ typedef struct MemoryContextData
MemoryContext firstchild; /* head of linked list of children */
MemoryContext nextchild; /* next child of same parent */
char *name; /* context name (just for debugging) */
bool isReset; /* T = no space alloced since last reset */
} MemoryContextData;
/* utils/palloc.h contains typedef struct MemoryContextData *MemoryContext */