summaryrefslogtreecommitdiff
path: root/src/pl/tcl
diff options
context:
space:
mode:
authorTom Lane2001-10-06 23:21:45 +0000
committerTom Lane2001-10-06 23:21:45 +0000
commit85801a4dbdee22f230637311681b8b03a72979db (patch)
tree28054ba90fda332be0d5254e5bdaba5a2a51f1f2 /src/pl/tcl
parenta965750abf2504e266e5071dc90365be9485395a (diff)
Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfo
lookup info in the relcache for index access method support functions. This makes a huge difference for dynamically loaded support functions, and should save a few cycles even for built-in ones. Also tweak dfmgr.c so that load_external_function is called only once, not twice, when doing fmgr_info for a dynamically loaded function. All per performance gripe from Teodor Sigaev, 5-Oct-01.
Diffstat (limited to 'src/pl/tcl')
-rw-r--r--src/pl/tcl/pltcl.c14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/pl/tcl/pltcl.c b/src/pl/tcl/pltcl.c
index 29d6559821b..38d7d434501 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);
}
/**********************************************************************