summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-03-30 18:24:53 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-03-30 18:24:53 (GMT)
commita9bd49ae8fcf0c623db1d0f56503d58c5f952719 (patch)
tree7b79b56d8904253bbb565e8d136b5228b9f48a7f /generic
parent087978a04db7c55434843ec8327158a25d8e8c8c (diff)
downloadtcl-a9bd49ae8fcf0c623db1d0f56503d58c5f952719.zip
tcl-a9bd49ae8fcf0c623db1d0f56503d58c5f952719.tar.gz
tcl-a9bd49ae8fcf0c623db1d0f56503d58c5f952719.tar.bz2
* generic/tclCompile.c:
* generic/tclCompExpr.c: * generic/tclCompCmds.c: Replace arrays on the C stack and ckalloc calls with TclStackAlloc calls to use memory on Tcl's evaluation stack
Diffstat (limited to 'generic')
-rw-r--r--generic/tclCompile.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/generic/tclCompile.c b/generic/tclCompile.c
index 14f549d..0965afa 100644
--- a/generic/tclCompile.c
+++ b/generic/tclCompile.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: tclCompile.c,v 1.109 2007/03/20 03:16:10 dgp Exp $
+ * RCS: @(#) $Id: tclCompile.c,v 1.110 2007/03/30 18:24:54 dgp Exp $
*/
#include "tclInt.h"
@@ -1278,9 +1278,11 @@ TclCompileScript(
* might be a literal one coming after.
*/
- exp = (int *) ckalloc(sizeof(int) * parse.numWords);
- expLen = (int **) ckalloc(sizeof(int *) * parse.numWords);
- expItem = (char ***) ckalloc(sizeof(char **) * parse.numWords);
+ exp = (int *) TclStackAlloc(interp, sizeof(int) * parse.numWords);
+ expLen = (int **) TclStackAlloc(interp,
+ sizeof(int *) * parse.numWords);
+ expItem = (char ***) TclStackAlloc(interp,
+ sizeof(char **) * parse.numWords);
for (wordIdx = 0, tokenPtr = parse.tokenPtr;
wordIdx < parse.numWords;
@@ -1384,9 +1386,9 @@ TclCompileScript(
}
}
- ckfree((char *) exp);
- ckfree((char *) expLen);
- ckfree((char *) expItem);
+ TclStackFree(interp); /* expItem */
+ TclStackFree(interp); /* expLen */
+ TclStackFree(interp); /* exp */
envPtr->numCommands++;
currCmdIndex = (envPtr->numCommands - 1);