summaryrefslogtreecommitdiffstats
path: root/generic
diff options
context:
space:
mode:
authormsofer <msofer@noemail.net>2011-03-05 15:09:01 (GMT)
committermsofer <msofer@noemail.net>2011-03-05 15:09:01 (GMT)
commit2f902ceaf49da89cb0f4dc0ddb0f02374c6b6c8b (patch)
treecd7fbf0fbe27d0ed2e274f519ee07fed9331de9c /generic
parentf8866712f94365027611a04bd26007463c5c8d08 (diff)
downloadtcl-2f902ceaf49da89cb0f4dc0ddb0f02374c6b6c8b.zip
tcl-2f902ceaf49da89cb0f4dc0ddb0f02374c6b6c8b.tar.gz
tcl-2f902ceaf49da89cb0f4dc0ddb0f02374c6b6c8b.tar.bz2
* generic/tclExecute.c: cleaner mem management for TEBCdata
FossilOrigin-Name: 0798fea8d41638694e5e15c4af3347251f31c35b
Diffstat (limited to 'generic')
-rw-r--r--generic/tclExecute.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/generic/tclExecute.c b/generic/tclExecute.c
index 6703d43..5cffc90 100644
--- a/generic/tclExecute.c
+++ b/generic/tclExecute.c
@@ -178,6 +178,10 @@ typedef struct TEBCdata {
int cleanup; /* new codePtr was received for NR */
Tcl_Obj *auxObjList; /* execution. */
int checkInterp;
+ CmdFrame cmdFrame;
+ void * stack[1]; /* Start of the actual combined catch and obj
+ * stacks; the struct will be expanded as
+ * necessary */
} TEBCdata;
#define TEBC_YIELD() \
@@ -1910,8 +1914,8 @@ TclIncrObj(
*
*----------------------------------------------------------------------
*/
-#define bcFramePtr ((CmdFrame *) (TD + 1))
-#define initCatchTop (((ptrdiff_t *) (bcFramePtr + 1)) - 1)
+#define bcFramePtr (&TD->cmdFrame)
+#define initCatchTop ((ptrdiff_t *) (&TD->stack[-1]))
#define initTosPtr ((Tcl_Obj **) (initCatchTop+codePtr->maxExceptDepth))
#define esPtr (iPtr->execEnvPtr->execStackPtr)
@@ -1922,9 +1926,9 @@ TclNRExecuteByteCode(
{
Interp *iPtr = (Interp *) interp;
TEBCdata *TD;
- int size = sizeof(TEBCdata) + sizeof(CmdFrame) +
+ int size = sizeof(TEBCdata) -1 +
+ (codePtr->maxStackDepth + codePtr->maxExceptDepth)
- *(sizeof(Tcl_Obj *));
+ *(sizeof(void *));
int numWords = (size + sizeof(Tcl_Obj *) - 1)/sizeof(Tcl_Obj *);
if (iPtr->execEnvPtr->rewind) {