From 30e98a7e6e4869a7d6b3748ac9770bb8d69a8b26 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Sat, 21 May 2011 14:47:19 -0400 Subject: 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. --- src/include/nodes/memnodes.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/include/nodes') diff --git a/src/include/nodes/memnodes.h b/src/include/nodes/memnodes.h index b62ed8f904a..62a0f9730ed 100644 --- a/src/include/nodes/memnodes.h +++ b/src/include/nodes/memnodes.h @@ -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 */ -- cgit v1.2.3