From af1be9bf52f89afabce20af747ef40bcf6986e1d Mon Sep 17 00:00:00 2001 From: Miguel Sofer Date: Tue, 19 Jun 2007 20:21:43 +0000 Subject: improve comments on Tcl stack management --- generic/tclExecute.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/generic/tclExecute.c b/generic/tclExecute.c index eb077b6..20e61ea 100644 --- a/generic/tclExecute.c +++ b/generic/tclExecute.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclExecute.c,v 1.299 2007/06/19 19:50:10 msofer Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.300 2007/06/19 20:21:43 msofer Exp $ */ #include "tclInt.h" @@ -786,6 +786,11 @@ StackAllocWords( Tcl_Interp *interp, int numWords) { + /* + * Note that GrowEvaluationStack sets a marker in the stack. This marker + * is read when rewinding, e.g., by TclStackFree. + */ + Interp *iPtr = (Interp *) interp; ExecEnv *eePtr = iPtr->execEnvPtr; Tcl_Obj **resPtr = GrowEvaluationStack(eePtr, numWords, 0); @@ -811,6 +816,12 @@ void TclStackFree( Tcl_Interp *interp) { + /* + * Rewind the stack to the previous marker position. The current marker, + * as set in the last call to GrowEvaluationStack, contains a pointer to + * the previous marker. + */ + Interp *iPtr = (Interp *) interp; ExecEnv *eePtr = iPtr->execEnvPtr; ExecStack *esPtr = eePtr->execStackPtr; -- cgit v0.12