diff options
| author | mig <mig> | 2013-12-06 00:16:07 (GMT) |
|---|---|---|
| committer | mig <mig> | 2013-12-06 00:16:07 (GMT) |
| commit | 6557f3ac11f40dedfb7bec32f9d1029d2645405a (patch) | |
| tree | e3f848b42344013d3adaa8ea43adcc922d889493 | |
| parent | da3e64744b0cee3f710bbb90c2092e61372fbd25 (diff) | |
| download | tcl-6557f3ac11f40dedfb7bec32f9d1029d2645405a.zip tcl-6557f3ac11f40dedfb7bec32f9d1029d2645405a.tar.gz tcl-6557f3ac11f40dedfb7bec32f9d1029d2645405a.tar.bz2 | |
tighter mem management in array-set compiler
| -rw-r--r-- | generic/tclCompCmds.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index da14af1..73b1ec3 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -323,11 +323,11 @@ TclCompileArraySetCmd( keyVar = AnonymousLocal(envPtr); valVar = AnonymousLocal(envPtr); - infoPtr = ckalloc(sizeof(ForeachInfo) + sizeof(ForeachVarList *)); + infoPtr = ckalloc(sizeof(ForeachInfo)); infoPtr->numLists = 1; infoPtr->firstValueTemp = dataVar; infoPtr->loopCtTemp = iterVar; - infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) * 2*sizeof(int)); + infoPtr->varLists[0] = ckalloc(sizeof(ForeachVarList) + sizeof(int)); infoPtr->varLists[0]->numVars = 2; infoPtr->varLists[0]->varIndexes[0] = keyVar; infoPtr->varLists[0]->varIndexes[1] = valVar; |
