summaryrefslogtreecommitdiffstats
path: root/generic/tclProc.c
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-06-20 18:46:05 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-06-20 18:46:05 (GMT)
commit990150fd25c8206ca25d424fafbdfd2b81199d1f (patch)
tree3d231361d50bc42a020d3f65eefb68a5951da2ae /generic/tclProc.c
parent03e71e94a6bfa74deaf5a629ba1b72353f17bfc7 (diff)
downloadtcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.zip
tcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.tar.gz
tcl-990150fd25c8206ca25d424fafbdfd2b81199d1f.tar.bz2
* generic/tclInt.decls: Revised the interfaces of the routines
* generic/tclExecute.c: TclStackAlloc and TclStackFree to make them easier for callers to use (or more precisely, harder to misuse). TclStackFree now takes a (void *) argument which is the pointer intended to be freed. TclStackFree will panic if that's not actually the memory the call will free. TSA/TSF also now tolerate receiving (interp == NULL), in which case they simply fall back to be calls to Tcl_Alloc/Tcl_Free. * generic/tclIntDecls.h: make genstubs * generic/tclBasic.c: Updated callers * generic/tclCmdAH.c: * generic/tclCmdIL.c: * generic/tclCompCmds.c: * generic/tclCompExpr.c: * generic/tclCompile.c: * generic/tclFCmd.c: * generic/tclFileName.c: * generic/tclIOCmd.c: * generic/tclIndexObj.c: * generic/tclInterp.c: * generic/tclNamesp.c: * generic/tclProc.c: * generic/tclTrace.c: * unix/tclUnixPipe.c:
Diffstat (limited to 'generic/tclProc.c')
-rw-r--r--generic/tclProc.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/generic/tclProc.c b/generic/tclProc.c
index 5253e21..8cd8aa1 100644
--- a/generic/tclProc.c
+++ b/generic/tclProc.c
@@ -11,7 +11,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.124 2007/06/18 22:51:12 msofer Exp $
+ * RCS: @(#) $Id: tclProc.c,v 1.125 2007/06/20 18:46:14 dgp Exp $
*/
#include "tclInt.h"
@@ -270,7 +270,7 @@ Tcl_ProcObjCmd(
Tcl_DecrRefCount(contextPtr->data.eval.path);
contextPtr->data.eval.path = NULL;
}
- TclStackFree(interp); /* contextPtr */
+ TclStackFree(interp, contextPtr);
}
/*
@@ -1222,7 +1222,7 @@ InitArgsAndLocals(
for (i=0 ; i<=numArgs ; i++) {
Tcl_DecrRefCount(desiredObjs[i]);
}
- TclStackFree(interp);
+ TclStackFree(interp, desiredObjs);
return TCL_ERROR;
}
@@ -1565,6 +1565,7 @@ TclObjInterpProcCore(
{
register Proc *procPtr = ((Interp *)interp)->varFramePtr->procPtr;
int result;
+ CallFrame *freePtr;
result = InitArgsAndLocals(interp, procNameObj, skip);
if (result != TCL_OK) {
@@ -1680,9 +1681,11 @@ TclObjInterpProcCore(
* allocated later on the stack.
*/
+ freePtr = ((Interp *)interp)->framePtr;
Tcl_PopCallFrame(interp); /* Pop but do not free. */
- TclStackFree(interp); /* Free compiledLocals. */
- TclStackFree(interp); /* Free CallFrame. */
+ TclStackFree(interp, freePtr->compiledLocals);
+ /* Free compiledLocals. */
+ TclStackFree(interp, freePtr); /* Free CallFrame. */
return result;
}
@@ -2401,7 +2404,7 @@ SetLambdaFromAny(
Tcl_DecrRefCount(contextPtr->data.eval.path);
}
- TclStackFree(interp); /* contextPtr */
+ TclStackFree(interp, contextPtr);
}
/*