summaryrefslogtreecommitdiffstats
path: root/generic/tclExecute.c
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2009-05-08 01:02:26 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2009-05-08 01:02:26 (GMT)
commit7592bff0075283d77566536c9bea32df7073e73d (patch)
tree3cdc92382395a57ab68cc6fdb3b197d39dc8000d /generic/tclExecute.c
parent33fd9238dc467ef70e757a917e4c8ddd2dd7d78e (diff)
downloadtcl-7592bff0075283d77566536c9bea32df7073e73d.zip
tcl-7592bff0075283d77566536c9bea32df7073e73d.tar.gz
tcl-7592bff0075283d77566536c9bea32df7073e73d.tar.bz2
* generic/tclBasic.c: Let coroutines start with a much smaller
* generic/tclCompile.h: stack: 200 words (previously was 2000, * generic/tclExecute.c: the same as interps)
Diffstat (limited to 'generic/tclExecute.c')
-rw-r--r--generic/tclExecute.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index a30c46e..e6eff03 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -14,7 +14,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.434 2009/05/06 20:16:17 dgp Exp $
+ * RCS: @(#) $Id: tclExecute.c,v 1.435 2009/05/08 01:02:26 msofer Exp $
*/
#include "tclInt.h"
@@ -788,16 +788,16 @@ InitByteCodeExecution(
*----------------------------------------------------------------------
*/
-#define TCL_STACK_INITIAL_SIZE 2000
-
ExecEnv *
TclCreateExecEnv(
- Tcl_Interp *interp) /* Interpreter for which the execution
+ Tcl_Interp *interp, /* Interpreter for which the execution
* environment is being created. */
+ int size) /* the initial stack size, in number of words
+ * [sizeof(Tcl_Obj*)] */
{
ExecEnv *eePtr = (ExecEnv *) ckalloc(sizeof(ExecEnv));
ExecStack *esPtr = (ExecStack *) ckalloc(sizeof(ExecStack)
- + (size_t) (TCL_STACK_INITIAL_SIZE-1) * sizeof(Tcl_Obj *));
+ + (size_t) (size-1) * sizeof(Tcl_Obj *));
eePtr->execStackPtr = esPtr;
TclNewBooleanObj(eePtr->constants[0], 0);
@@ -813,7 +813,7 @@ TclCreateExecEnv(
esPtr->prevPtr = NULL;
esPtr->nextPtr = NULL;
esPtr->markerPtr = NULL;
- esPtr->endPtr = &esPtr->stackWords[TCL_STACK_INITIAL_SIZE-1];
+ esPtr->endPtr = &esPtr->stackWords[size-1];
esPtr->tosPtr = &esPtr->stackWords[-1];
Tcl_MutexLock(&execMutex);
@@ -826,7 +826,6 @@ TclCreateExecEnv(
return eePtr;
}
-#undef TCL_STACK_INITIAL_SIZE
/*
*----------------------------------------------------------------------