diff options
Diffstat (limited to 'src/pl')
| -rw-r--r-- | src/pl/plperl/plperl.c | 14 | ||||
| -rw-r--r-- | src/pl/plpgsql/src/pl_comp.c | 14 | ||||
| -rw-r--r-- | src/pl/plpython/plpython.c | 14 | ||||
| -rw-r--r-- | src/pl/tcl/pltcl.c | 14 |
4 files changed, 20 insertions, 36 deletions
diff --git a/src/pl/plperl/plperl.c b/src/pl/plperl/plperl.c index cb733d7970..b59486860e 100644 --- a/src/pl/plperl/plperl.c +++ b/src/pl/plperl/plperl.c @@ -33,7 +33,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.22 2001/06/18 21:40:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plperl/plperl.c,v 1.23 2001/10/06 23:21:44 tgl Exp $ * **********************************************************************/ @@ -171,18 +171,14 @@ static void plperl_set_tuple_values(Tcl_Interp *interp, char *arrayname, * data structures such as fmgr info records therefore must live forever * as well. A better implementation would store all this stuff in a per- * function memory context that could be reclaimed at need. In the meantime, - * fmgr_info must be called in TopMemoryContext so that whatever it might - * allocate, and whatever the eventual function might allocate using fn_mcxt, - * will live forever too. + * fmgr_info_cxt must be called specifying TopMemoryContext so that whatever + * it might allocate, and whatever the eventual function might allocate using + * fn_mcxt, will live forever too. */ static void perm_fmgr_info(Oid functionId, FmgrInfo *finfo) { - MemoryContext oldcontext; - - oldcontext = MemoryContextSwitchTo(TopMemoryContext); - fmgr_info(functionId, finfo); - MemoryContextSwitchTo(oldcontext); + fmgr_info_cxt(functionId, finfo, TopMemoryContext); } /********************************************************************** diff --git a/src/pl/plpgsql/src/pl_comp.c b/src/pl/plpgsql/src/pl_comp.c index 2ab6632e33..5c7e12ad19 100644 --- a/src/pl/plpgsql/src/pl_comp.c +++ b/src/pl/plpgsql/src/pl_comp.c @@ -3,7 +3,7 @@ * procedural language * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.33 2001/07/12 17:42:07 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpgsql/src/pl_comp.c,v 1.34 2001/10/06 23:21:44 tgl Exp $ * * This software is copyrighted by Jan Wieck - Hamburg. * @@ -92,18 +92,14 @@ PLpgSQL_function *plpgsql_curr_compile; * data structures such as fmgr info records therefore must live forever * as well. A better implementation would store all this stuff in a per- * function memory context that could be reclaimed at need. In the meantime, - * fmgr_info must be called in TopMemoryContext so that whatever it might - * allocate, and whatever the eventual function might allocate using fn_mcxt, - * will live forever too. + * fmgr_info_cxt must be called specifying TopMemoryContext so that whatever + * it might allocate, and whatever the eventual function might allocate using + * fn_mcxt, will live forever too. */ static void perm_fmgr_info(Oid functionId, FmgrInfo *finfo) { - MemoryContext oldcontext; - - oldcontext = MemoryContextSwitchTo(TopMemoryContext); - fmgr_info(functionId, finfo); - MemoryContextSwitchTo(oldcontext); + fmgr_info_cxt(functionId, finfo, TopMemoryContext); } diff --git a/src/pl/plpython/plpython.c b/src/pl/plpython/plpython.c index cd3486fa6d..8dcfb1c970 100644 --- a/src/pl/plpython/plpython.c +++ b/src/pl/plpython/plpython.c @@ -29,7 +29,7 @@ * MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.7 2001/10/04 15:45:49 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/plpython/plpython.c,v 1.8 2001/10/06 23:21:45 tgl Exp $ * ********************************************************************* */ @@ -308,18 +308,14 @@ volatile int func_leave_calls = 0; * data structures such as fmgr info records therefore must live forever * as well. A better implementation would store all this stuff in a per- * function memory context that could be reclaimed at need. In the meantime, - * fmgr_info must be called in TopMemoryContext so that whatever it might - * allocate, and whatever the eventual function might allocate using fn_mcxt, - * will live forever too. + * fmgr_info_cxt must be called specifying TopMemoryContext so that whatever + * it might allocate, and whatever the eventual function might allocate using + * fn_mcxt, will live forever too. */ static void perm_fmgr_info(Oid functionId, FmgrInfo *finfo) { - MemoryContext oldcontext; - - oldcontext = MemoryContextSwitchTo(TopMemoryContext); - fmgr_info(functionId, finfo); - MemoryContextSwitchTo(oldcontext); + fmgr_info_cxt(functionId, finfo, TopMemoryContext); } diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c index 29d6559821..38d7d43450 100644 --- a/src/pl/tcl/pltcl.c +++ b/src/pl/tcl/pltcl.c @@ -31,7 +31,7 @@ * ENHANCEMENTS, OR MODIFICATIONS. * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.42 2001/10/04 15:48:37 momjian Exp $ + * $Header: /cvsroot/pgsql/src/pl/tcl/pltcl.c,v 1.43 2001/10/06 23:21:45 tgl Exp $ * **********************************************************************/ @@ -187,18 +187,14 @@ static int pltcl_SPI_lastoid(ClientData cdata, Tcl_Interp *interp, * data structures such as fmgr info records therefore must live forever * as well. A better implementation would store all this stuff in a per- * function memory context that could be reclaimed at need. In the meantime, - * fmgr_info must be called in TopMemoryContext so that whatever it might - * allocate, and whatever the eventual function might allocate using fn_mcxt, - * will live forever too. + * fmgr_info_cxt must be called specifying TopMemoryContext so that whatever + * it might allocate, and whatever the eventual function might allocate using + * fn_mcxt, will live forever too. */ static void perm_fmgr_info(Oid functionId, FmgrInfo *finfo) { - MemoryContext oldcontext; - - oldcontext = MemoryContextSwitchTo(TopMemoryContext); - fmgr_info(functionId, finfo); - MemoryContextSwitchTo(oldcontext); + fmgr_info_cxt(functionId, finfo, TopMemoryContext); } /********************************************************************** |
