mirror of
https://github.com/postgres/postgres.git
synced 2025-11-01 21:31:19 +03:00
Clean up per-tuple memory leaks in trigger firing and plpgsql
expression evaluation.
This commit is contained in:
@@ -7,7 +7,7 @@
|
||||
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* $Id: executor.h,v 1.53 2000/11/12 00:37:01 tgl Exp $
|
||||
* $Id: executor.h,v 1.54 2001/01/22 00:50:07 tgl Exp $
|
||||
*
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
@@ -153,6 +153,24 @@ extern void FreeExprContext(ExprContext *econtext);
|
||||
#define ResetExprContext(econtext) \
|
||||
MemoryContextReset((econtext)->ecxt_per_tuple_memory)
|
||||
|
||||
extern ExprContext *MakePerTupleExprContext(EState *estate);
|
||||
|
||||
/* Get an EState's per-output-tuple exprcontext, making it if first use */
|
||||
#define GetPerTupleExprContext(estate) \
|
||||
((estate)->es_per_tuple_exprcontext ? \
|
||||
(estate)->es_per_tuple_exprcontext : \
|
||||
MakePerTupleExprContext(estate))
|
||||
|
||||
#define GetPerTupleMemoryContext(estate) \
|
||||
(GetPerTupleExprContext(estate)->ecxt_per_tuple_memory)
|
||||
|
||||
/* Reset an EState's per-output-tuple exprcontext, if one's been created */
|
||||
#define ResetPerTupleExprContext(estate) \
|
||||
do { \
|
||||
if ((estate)->es_per_tuple_exprcontext) \
|
||||
ResetExprContext((estate)->es_per_tuple_exprcontext); \
|
||||
} while (0)
|
||||
|
||||
extern void ExecOpenIndices(ResultRelInfo *resultRelInfo);
|
||||
extern void ExecCloseIndices(ResultRelInfo *resultRelInfo);
|
||||
extern void ExecInsertIndexTuples(TupleTableSlot *slot, ItemPointer tupleid,
|
||||
|
||||
Reference in New Issue
Block a user