From a9bd49ae8fcf0c623db1d0f56503d58c5f952719 Mon Sep 17 00:00:00 2001 From: dgp Date: Fri, 30 Mar 2007 18:24:53 +0000 Subject: * 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 --- ChangeLog | 1 + generic/tclCompile.c | 16 +++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/ChangeLog b/ChangeLog index 109b9f8..13f809a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,6 @@ 2007-03-30 Don Porter + * 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 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); -- cgit v0.12