summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-12-15 20:44:17 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-12-15 20:44:17 (GMT)
commit96a4475c4aa4e7f173d328e2a6f37770ae35f497 (patch)
tree03db1466c686ac3541167c4b12439b026a69750f /generic/tclProc.c
parente3284f29c46d7eb7bdc8b89b1094f1024310bfc7 (diff)
downloadtcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.zip
tcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.tar.gz
tcl-96a4475c4aa4e7f173d328e2a6f37770ae35f497.tar.bz2
* generic/tclTest.c: Added two new functions to allocate memory
from the execution stack (TclStackAlloc, TclStackFree). Added functions TclPushStackFrame and TclPopStackFrame that do the work of Tcl_PushCallFrame and Tcl_PopCallFrame, but using frames allocated in the execution stack - i.e., heap instead of C-stack. The core uses these two new functions exclusively; the old ones remain for backwards compat, as at least two popular extensions (itcl, xotcl) are known to use them.
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index bcf82d2..feda831 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -10,7 +10,7 @@
* See the file "license.terms" for information on usage and redistribution
* of this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tclProc.c,v 1.68 2004/12/14 21:11:47 msofer Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.69 2004/12/15 20:44:41 msofer Exp $
*/
#include "tclInt.h"
@@ -918,8 +918,7 @@ TclObjInterpProc(clientData, interp, objc, objv)
{
register Proc *procPtr = (Proc *) clientData;
Namespace *nsPtr = procPtr->cmdPtr->nsPtr;
- CallFrame frame;
- register CallFrame *framePtr = &frame;
+ CallFrame *framePtr, **framePtrPtr;
register Var *varPtr;
register CompiledLocal *localPtr;
char *procName;
@@ -975,7 +974,8 @@ TclObjInterpProc(clientData, interp, objc, objv)
* from one namespace to another.
*/
- result = Tcl_PushCallFrame(interp, (Tcl_CallFrame *) framePtr,
+ framePtrPtr = &framePtr;
+ result = TclPushStackFrame(interp, (Tcl_CallFrame **) framePtrPtr,
(Tcl_Namespace *) nsPtr, FRAME_IS_PROC);
if (result != TCL_OK) {
@@ -1139,7 +1139,7 @@ TclObjInterpProc(clientData, interp, objc, objv)
*/
procDone:
- Tcl_PopCallFrame(interp);
+ TclPopStackFrame(interp);
if (compiledLocals != localStorage) {
ckfree((char *) compiledLocals);
}
@@ -1181,7 +1181,7 @@ TclProcCompileProc(interp, procPtr, bodyPtr, nsPtr, description, procName)
{
Interp *iPtr = (Interp*)interp;
int result;
- Tcl_CallFrame frame;
+ Tcl_CallFrame *framePtr;
Proc *saveProcPtr;
ByteCode *codePtr = (ByteCode *) bodyPtr->internalRep.otherValuePtr;
@@ -1247,12 +1247,12 @@ TclProcCompileProc(interp, procPtr, bodyPtr, nsPtr, description, procName)
saveProcPtr = iPtr->compiledProcPtr;
iPtr->compiledProcPtr = procPtr;
- result = Tcl_PushCallFrame(interp, &frame,
+ result = TclPushStackFrame(interp, &framePtr,
(Tcl_Namespace*)nsPtr, /* isProcCallFrame */ 0);
if (result == TCL_OK) {
result = tclByteCodeType.setFromAnyProc(interp, bodyPtr);
- Tcl_PopCallFrame(interp);
+ TclPopStackFrame(interp);
}
iPtr->compiledProcPtr = saveProcPtr;