From 3c995152fdd1a379578052a87aba364ecdcffa57 Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Thu, 26 Oct 2006 17:22:17 +0000 Subject: * generic/tclInterp.c (ApplyObjCmd):a * generic/tclNamesp.c (EnsembleImplementationCmd): replaced ckalloc (heap) with TclStackAlloc (execution stack). --- generic/tclInterp.c | 7 ++++--- generic/tclNamesp.c | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/generic/tclInterp.c b/generic/tclInterp.c index 9de1fbd..0156391 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.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: tclInterp.c,v 1.65 2006/10/24 00:29:30 msofer Exp $ + * RCS: @(#) $Id: tclInterp.c,v 1.66 2006/10/26 17:22:17 msofer Exp $ */ #include "tclInt.h" @@ -1710,7 +1710,8 @@ AliasObjCmd( if (cmdc <= ALIAS_CMDV_PREALLOC) { cmdv = cmdArr; } else { - cmdv = (Tcl_Obj **) ckalloc((unsigned) (cmdc * sizeof(Tcl_Obj *))); + cmdv = (Tcl_Obj **) TclStackAlloc(interp, + (unsigned) (cmdc * sizeof(Tcl_Obj *))); } prefv = &aliasPtr->objPtr; @@ -1763,7 +1764,7 @@ AliasObjCmd( } if (cmdv != cmdArr) { - ckfree((char *) cmdv); + TclStackFree(interp); } return result; #undef ALIAS_CMDV_PREALLOC diff --git a/generic/tclNamesp.c b/generic/tclNamesp.c index a2a1632..f0c5ff8 100644 --- a/generic/tclNamesp.c +++ b/generic/tclNamesp.c @@ -22,7 +22,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclNamesp.c,v 1.105 2006/10/23 22:49:25 msofer Exp $ + * RCS: @(#) $Id: tclNamesp.c,v 1.106 2006/10/26 17:22:17 msofer Exp $ */ #include "tclInt.h" @@ -6272,13 +6272,13 @@ NsEnsembleImplementationCmd( iPtr->ensembleRewrite.numInsertedObjs += prefixObjc - 2; } } - tempObjv = (Tcl_Obj **) ckalloc(sizeof(Tcl_Obj *)*(objc-2+prefixObjc)); + tempObjv = (Tcl_Obj **) TclStackAlloc(interp, sizeof(Tcl_Obj *)*(objc-2+prefixObjc)); memcpy(tempObjv, prefixObjv, sizeof(Tcl_Obj *) * prefixObjc); memcpy(tempObjv+prefixObjc, objv+2, sizeof(Tcl_Obj *) * (objc-2)); result = Tcl_EvalObjv(interp, objc-2+prefixObjc, tempObjv, TCL_EVAL_INVOKE|TCL_EVAL_NOREWRITE); Tcl_DecrRefCount(prefixObj); - ckfree((char *) tempObjv); + TclStackFree(interp); if (isRootEnsemble) { iPtr->ensembleRewrite.sourceObjs = NULL; iPtr->ensembleRewrite.numRemovedObjs = 0; -- cgit v0.12