diff options
Diffstat (limited to 'generic/tclCmdMZ.c')
-rw-r--r-- | generic/tclCmdMZ.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/generic/tclCmdMZ.c b/generic/tclCmdMZ.c index d85cd83..05f2e5d 100644 --- a/generic/tclCmdMZ.c +++ b/generic/tclCmdMZ.c @@ -1835,7 +1835,7 @@ StringMapCmd( * adapt this code... */ - mapElemv = ckalloc(sizeof(Tcl_Obj *) * mapElemc); + mapElemv = TclStackAlloc(interp, sizeof(Tcl_Obj *) * mapElemc); Tcl_DictObjFirst(interp, objv[objc-2], &search, mapElemv+0, mapElemv+1, &done); for (i=2 ; i<mapElemc ; i+=2) { @@ -1944,10 +1944,10 @@ StringMapCmd( * case. */ - mapStrings = ckalloc(mapElemc*2*sizeof(Tcl_UniChar *)); - mapLens = ckalloc(mapElemc * 2 * sizeof(int)); + mapStrings = TclStackAlloc(interp, mapElemc*2*sizeof(Tcl_UniChar *)); + mapLens = TclStackAlloc(interp, mapElemc * 2 * sizeof(int)); if (nocase) { - u2lc = ckalloc(mapElemc * sizeof(Tcl_UniChar)); + u2lc = TclStackAlloc(interp, mapElemc * sizeof(Tcl_UniChar)); } for (index = 0; index < mapElemc; index++) { mapStrings[index] = Tcl_GetUnicodeFromObj(mapElemv[index], @@ -1997,10 +1997,10 @@ StringMapCmd( } } if (nocase) { - ckfree(u2lc); + TclStackFree(interp, u2lc); } - ckfree(mapLens); - ckfree(mapStrings); + TclStackFree(interp, mapLens); + TclStackFree(interp, mapStrings); } if (p != ustring1) { /* @@ -2012,7 +2012,7 @@ StringMapCmd( Tcl_SetObjResult(interp, resultPtr); done: if (mapWithDict) { - ckfree(mapElemv); + TclStackFree(interp, mapElemv); } if (copySource) { Tcl_DecrRefCount(sourceObj); @@ -3849,7 +3849,7 @@ TclNRSwitchObjCmd( */ matchFound: - ctxPtr = ckalloc(sizeof(CmdFrame)); + ctxPtr = TclStackAlloc(interp, sizeof(CmdFrame)); *ctxPtr = *iPtr->cmdFramePtr; if (splitObjs) { @@ -3966,7 +3966,7 @@ SwitchPostProc( (overflow ? limit : patternLength), pattern, (overflow ? "..." : ""), Tcl_GetErrorLine(interp))); } - ckfree(ctxPtr); + TclStackFree(interp, ctxPtr); return result; } @@ -4729,7 +4729,7 @@ TclNRWhileObjCmd( * We reuse [for]'s callback, passing a NULL for the 'next' script. */ - TclCkSmallAlloc(sizeof(ForIterData), iterPtr); + TclSmallAllocEx(interp, sizeof(ForIterData), iterPtr); iterPtr->cond = objv[1]; iterPtr->body = objv[2]; iterPtr->next = NULL; |