summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-06-19 20:21:43 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-06-19 20:21:43 (GMT)
commitaf1be9bf52f89afabce20af747ef40bcf6986e1d (patch)
tree013ecf18b338376bdea59f2f0dff946bb213151a
parente9fbd6e496f899cfca24c20ef12b68d0fecdde5e (diff)
downloadtcl-af1be9bf52f89afabce20af747ef40bcf6986e1d.zip
tcl-af1be9bf52f89afabce20af747ef40bcf6986e1d.tar.gz
tcl-af1be9bf52f89afabce20af747ef40bcf6986e1d.tar.bz2
improve comments on Tcl stack management
-rw-r--r--generic/tclExecute.c13
1 files changed, 12 insertions, 1 deletions
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;