From 8c077c7737d8f145bda783f4f6ae7b66660d5c3d Mon Sep 17 00:00:00 2001 From: andreas_kupries Date: Tue, 4 Dec 2001 21:52:07 +0000 Subject: * NOTES: * tcl.h: * tclInt.h: Moved the macros to control feature exclusion and stack manipulation into the private area of the tcl headers. Renamed the macros for TCL_STRUCT_ON_HEAP to make their names more sensible. * tclCmdAH.c: * tclCompCmds.c: * tclCompExpr.c: * tclCompile.c: * tclExecute.c: * tclIO.c: * tclParse.c: * tclParseExpr.c: * tclScan.c: * tclUnixChan.c: Adapted to changed macro names, added some more places there structures go on the heap instead of the stack. Fixed a problem with TCL_FMT_STATIC_FLOATBUFFER_SZ which caused the interp to crash when actually used to reduce the usage of the stack. --- ChangeLog | 24 +++++++++++++ NOTES | 8 +++++ generic/tcl.h | 91 +--------------------------------------------- generic/tclCmdAH.c | 8 ++--- generic/tclCompCmds.c | 71 +++++++++++++++++++----------------- generic/tclCompExpr.c | 8 ++--- generic/tclCompile.c | 16 ++++----- generic/tclExecute.c | 10 +++--- generic/tclIO.c | 4 +-- generic/tclInt.h | 97 +++++++++++++++++++++++++++++++++++++++++++++++++- generic/tclParse.c | 42 +++++++++++----------- generic/tclParseExpr.c | 38 ++++++++++---------- generic/tclScan.c | 20 +++++++---- unix/tclUnixChan.c | 32 ++++++++++------- 14 files changed, 264 insertions(+), 205 deletions(-) diff --git a/ChangeLog b/ChangeLog index d255a2e..502fbed 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,27 @@ +2001-12-04 Andreas Kupries + + * NOTES: + * tcl.h: + * tclInt.h: Moved the macros to control feature exclusion and + stack manipulation into the private area of the tcl + headers. Renamed the macros for TCL_STRUCT_ON_HEAP to make their + names more sensible. + + * tclCmdAH.c: + * tclCompCmds.c: + * tclCompExpr.c: + * tclCompile.c: + * tclExecute.c: + * tclIO.c: + * tclParse.c: + * tclParseExpr.c: + * tclScan.c: + * tclUnixChan.c: Adapted to changed macro names, added some more + places their structures go on the heap instead of the stacke + stack. Fixed a problem with TCL_FMT_STATIC_FLOATBUFFER_SZ which + caused the interp to crash when actually used to reduce the + usage of the stack. + 2001-12-03 Andreas Kupries * NOTES: diff --git a/NOTES b/NOTES index 950c661..8984de4 100644 --- a/NOTES +++ b/NOTES @@ -249,3 +249,11 @@ On Heap @ TclCompileIncrCmd ../../src/tcl834_stkr/unix/../generic/tclCompCmds.c 1356 = 264 ----------------------------------------------------------------------------------------------- + +TclObjInterpProc + 832, 792, 752 + => STATIC_CLOCALS 20 ==> 716 bytes accounted for. + => STATIC_CLOCALS is of help and changing it does not crash the interp. + +TclInvokeStringCommand + TCL_INVOKE_STATIC_ARGS => 20 x char* = 80 diff --git a/generic/tcl.h b/generic/tcl.h index 84e1e0a..ca46b16 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -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: tcl.h,v 1.70.2.9.2.2 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tcl.h,v 1.70.2.9.2.3 2001/12/04 21:52:08 andreas_kupries Exp $ */ #ifndef _TCL @@ -26,95 +26,6 @@ extern "C" { #endif -/* The following are - * - a clause to activate all macros cutting features out of the core. - * - feature dependencies - */ - -#ifdef MODULAR_TCL -#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ -#define TCL_NO_TTY /* Disable "tty" channel driver */ -#define TCL_NO_PIPES /* Disable "pipe" channel driver */ -#define TCL_NO_PIDCMD /* Disable "pid" command */ -#define TCL_NO_NONSTDCHAN /* Disable creation of channels beyond std* */ -#define TCL_NO_CHANNELCOPY /* Disable channel copying, C/Tcl [fcopy] */ -#define TCL_NO_CHANNEL_READ /* Disable Tcl_ReadChars, [read] */ -#define TCL_NO_CHANNEL_EOF /* Disable [eof] */ -#define TCL_NO_CHANNEL_CONFIG /* Disable [fconfigure] and Tcl_GetChannelOption */ -#define TCL_NO_CHANNEL_BLOCKED /* Disable [fblocked] */ -#define TCL_NO_FILEEVENTS /* Disable [fileevent] and underlying APIs */ -#define TCL_NO_FILESYSTEM /* Disable everything related to the filesystem */ -#define TCL_NO_LOADCMD /* Disable [load] and machinery below */ -#define TCL_NO_SLAVEINTERP /* No slave interp's */ -#define TCL_NO_CMDALIASES /* No command aliases */ -#define TCL_STRUCT_ON_HEAP /* Allocate temp. big structures off the heap */ -#endif - -#ifdef TCL_NO_NONSTDCHAN -#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ -#define TCL_NO_TTY /* Disable "tty" channel driver */ -#define TCL_NO_PIPES /* Disable "pipe" channel driver */ -#endif - - -#ifdef TCL_STRUCT_ON_HEAP -#define TYPE(t) t * -#define ITEM(var,item) var -> item -#define REF(var) (var) -#define NEWSTRUCT(t,var) (var) = (t *) Tcl_Alloc(sizeof(t)) -#define RELSTRUCT(var) Tcl_Free((void*)(var)) -#else -#define TYPE(t) t -#define ITEM(var,item) var . item -#define REF(var) &(var) -#define NEWSTRUCT(t,var) -#define RELSTRUCT(var) -#endif - -/* - * Additional macros to control the sizes of various data placed on the stack. - */ - -#ifndef TCL_FMT_STATIC_FLOATBUFFER_SZ -#define TCL_FMT_STATIC_FLOATBUFFER_SZ 320 -#endif -#ifndef TCL_FMT_STATIC_VALIDATE_LIST -#define TCL_FMT_STATIC_VALIDATE_LIST 16 -#endif -#ifndef TCL_FOREACH_STATIC_ARGS -#define TCL_FOREACH_STATIC_ARGS 9 -#endif -#ifndef TCL_FOREACH_STATIC_LIST_SZ -#define TCL_FOREACH_STATIC_LIST_SZ 4 -#endif -#ifndef TCL_FOREACH_STATIC_VARLIST_SZ -#define TCL_FOREACH_STATIC_VARLIST_SZ 5 -#endif -#ifndef TCL_RESULT_APPEND_STATIC_LIST_SZ -#define TCL_RESULT_APPEND_STATIC_LIST_SZ 16 -#endif -#ifndef TCL_MERGE_STATIC_LIST_SZ -#define TCL_MERGE_STATIC_LIST_SZ 20 -#endif -#ifndef TCL_PROC_STATIC_CLOCALS -#define TCL_PROC_STATIC_CLOCALS 20 -#endif -#ifndef TCL_PROC_STATIC_ARGS -#define TCL_PROC_STATIC_ARGS 20 -#endif -#ifndef TCL_INVOKE_STATIC_ARGS -#define TCL_INVOKE_STATIC_ARGS 20 -#endif -#ifndef TCL_EVAL_STATIC_VARCHARS -#define TCL_EVAL_STATIC_VARCHARS 30 -#endif -#ifndef TCL_STATS_COUNTERS -#define TCL_STATS_COUNTERS 10 -#endif -#ifndef TCL_LSORT_STATIC_MERGE_BUCKETS -#define TCL_LSORT_STATIC_MERGE_BUCKETS 30 -#endif - /* * The following defines are used to indicate the various release levels. */ diff --git a/generic/tclCmdAH.c b/generic/tclCmdAH.c index 2979c97..d8399db 100644 --- a/generic/tclCmdAH.c +++ b/generic/tclCmdAH.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCmdAH.c,v 1.12.2.2.2.2 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tclCmdAH.c,v 1.12.2.2.2.3 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1972,15 +1972,15 @@ Tcl_FormatObjCmd(dummy, interp, objc, objv) # define PTR_VALUE 2 # define DOUBLE_VALUE 3 # define STRING_VALUE 4 -# define MAX_FLOAT_SIZE TCL_FMT_STATIC_FLOATBUFFER_SZ +# define MAX_FLOAT_SIZE 320 Tcl_Obj *resultPtr; /* Where result is stored finally. */ - char staticBuf[MAX_FLOAT_SIZE + 1]; + char staticBuf[TCL_FMT_STATIC_FLOATBUFFER_SZ + 1]; /* A static buffer to copy the format results * into */ char *dst = staticBuf; /* The buffer that sprintf writes into each * time the format processes a specifier */ - int dstSize = MAX_FLOAT_SIZE; + int dstSize = TCL_FMT_STATIC_FLOATBUFFER_SZ; /* The size of the dst buffer */ int noPercent; /* Special case for speed: indicates there's * no field specifier, just a string to copy.*/ diff --git a/generic/tclCompCmds.c b/generic/tclCompCmds.c index 8eab8b5..ec7f430 100644 --- a/generic/tclCompCmds.c +++ b/generic/tclCompCmds.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompCmds.c,v 1.5.6.1 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tclCompCmds.c,v 1.5.6.2 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1022,10 +1022,10 @@ TclCompileIfCmd(interp, parsePtr, envPtr) * command created by Tcl_ParseCommand. */ CompileEnv *envPtr; /* Holds resulting instructions. */ { - JumpFixupArray jumpFalseFixupArray; + TEMP (JumpFixupArray) jumpFalseFixupArray; /* Used to fix the ifFalse jump after each * test when its target PC is determined. */ - JumpFixupArray jumpEndFixupArray; + TEMP (JumpFixupArray) jumpEndFixupArray; /* Used to fix the jump after each "then" * body to the end of the "if" when that PC * is determined. */ @@ -1033,10 +1033,14 @@ TclCompileIfCmd(interp, parsePtr, envPtr) int jumpDist, jumpFalseDist, jumpIndex; int numWords, wordIdx, numBytes, maxDepth, j, code; char *word; - char buffer[100]; + STRING (100,buffer); - TclInitJumpFixupArray(&jumpFalseFixupArray); - TclInitJumpFixupArray(&jumpEndFixupArray); + NEWTEMP(JumpFixupArray,jumpFalseFixupArray); + NEWTEMP(JumpFixupArray,jumpEndFixupArray); + NEWSTR(100,buffer); + + TclInitJumpFixupArray(REF (jumpFalseFixupArray)); + TclInitJumpFixupArray(REF (jumpEndFixupArray)); maxDepth = 0; code = TCL_OK; @@ -1091,13 +1095,13 @@ TclCompileIfCmd(interp, parsePtr, envPtr) goto done; } maxDepth = TclMax(envPtr->maxStackDepth, maxDepth); - if (jumpFalseFixupArray.next >= jumpFalseFixupArray.end) { - TclExpandJumpFixupArray(&jumpFalseFixupArray); + if (ITEM (jumpFalseFixupArray,next) >= ITEM (jumpFalseFixupArray,end)) { + TclExpandJumpFixupArray(REF (jumpFalseFixupArray)); } - jumpIndex = jumpFalseFixupArray.next; - jumpFalseFixupArray.next++; + jumpIndex = ITEM (jumpFalseFixupArray,next); + ITEM (jumpFalseFixupArray,next)++; TclEmitForwardJump(envPtr, TCL_FALSE_JUMP, - &(jumpFalseFixupArray.fixup[jumpIndex])); + &(ITEM (jumpFalseFixupArray,fixup)[jumpIndex])); /* * Skip over the optional "then" before the then clause. @@ -1149,12 +1153,12 @@ TclCompileIfCmd(interp, parsePtr, envPtr) * jumpEndFixupArray are indexed by "jumpIndex". */ - if (jumpEndFixupArray.next >= jumpEndFixupArray.end) { - TclExpandJumpFixupArray(&jumpEndFixupArray); + if (ITEM (jumpEndFixupArray,next) >= ITEM (jumpEndFixupArray,end)) { + TclExpandJumpFixupArray(REF (jumpEndFixupArray)); } - jumpEndFixupArray.next++; + ITEM (jumpEndFixupArray,next)++; TclEmitForwardJump(envPtr, TCL_UNCONDITIONAL_JUMP, - &(jumpEndFixupArray.fixup[jumpIndex])); + &(ITEM (jumpEndFixupArray,fixup)[jumpIndex])); /* * Fix the target of the jumpFalse after the test. Generate a 4 byte @@ -1165,15 +1169,15 @@ TclCompileIfCmd(interp, parsePtr, envPtr) */ jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpFalseFixupArray.fixup[jumpIndex].codeOffset; + - ITEM (jumpFalseFixupArray,fixup)[jumpIndex].codeOffset; if (TclFixupForwardJump(envPtr, - &(jumpFalseFixupArray.fixup[jumpIndex]), jumpDist, 120)) { + &(ITEM (jumpFalseFixupArray,fixup)[jumpIndex]), jumpDist, 120)) { /* * Adjust the code offset for the proceeding jump to the end * of the "if" command. */ - jumpEndFixupArray.fixup[jumpIndex].codeOffset += 3; + ITEM (jumpEndFixupArray,fixup)[jumpIndex].codeOffset += 3; } tokenPtr += (tokenPtr->numComponents + 1); @@ -1245,19 +1249,19 @@ TclCompileIfCmd(interp, parsePtr, envPtr) * Fix the unconditional jumps to the end of the "if" command. */ - for (j = jumpEndFixupArray.next; j > 0; j--) { + for (j = ITEM (jumpEndFixupArray,next); j > 0; j--) { jumpIndex = (j - 1); /* i.e. process the closest jump first */ jumpDist = (envPtr->codeNext - envPtr->codeStart) - - jumpEndFixupArray.fixup[jumpIndex].codeOffset; + - ITEM (jumpEndFixupArray,fixup)[jumpIndex].codeOffset; if (TclFixupForwardJump(envPtr, - &(jumpEndFixupArray.fixup[jumpIndex]), jumpDist, 127)) { + &(ITEM (jumpEndFixupArray,fixup)[jumpIndex]), jumpDist, 127)) { /* * Adjust the immediately preceeding "ifFalse" jump. We moved * it's target (just after this jump) down three bytes. */ unsigned char *ifFalsePc = envPtr->codeStart - + jumpFalseFixupArray.fixup[jumpIndex].codeOffset; + + ITEM (jumpFalseFixupArray,fixup)[jumpIndex].codeOffset; unsigned char opCode = *ifFalsePc; if (opCode == INST_JUMP_FALSE1) { jumpFalseDist = TclGetInt1AtPtr(ifFalsePc + 1); @@ -1278,9 +1282,12 @@ TclCompileIfCmd(interp, parsePtr, envPtr) */ done: - TclFreeJumpFixupArray(&jumpFalseFixupArray); - TclFreeJumpFixupArray(&jumpEndFixupArray); + TclFreeJumpFixupArray(REF (jumpFalseFixupArray)); + TclFreeJumpFixupArray(REF (jumpEndFixupArray)); envPtr->maxStackDepth = maxDepth; + RELTEMP(jumpFalseFixupArray); + RELTEMP(jumpEndFixupArray); + RELTEMP(buffer); return code; } @@ -1318,21 +1325,21 @@ TclCompileIncrCmd(interp, parsePtr, envPtr) CompileEnv *envPtr; /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *incrTokenPtr; - TYPE (Tcl_Parse) elemParse; + TEMP (Tcl_Parse) elemParse; int gotElemParse = 0; char *name, *elName, *p; int nameChars, elNameChars, haveImmValue, immValue, localIndex, i, code; int maxDepth = 0; char buffer[160]; - NEWSTRUCT (Tcl_Parse,elemParse); + NEWTEMP (Tcl_Parse,elemParse); envPtr->maxStackDepth = 0; if ((parsePtr->numWords != 2) && (parsePtr->numWords != 3)) { Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "wrong # args: should be \"incr varName ?increment?\"", -1); - RELSTRUCT(elemParse); + RELTEMP(elemParse); return TCL_ERROR; } @@ -1539,7 +1546,7 @@ TclCompileIncrCmd(interp, parsePtr, envPtr) if (gotElemParse) { Tcl_FreeParse(REF (elemParse)); } - RELSTRUCT (elemParse); + RELTEMP (elemParse); envPtr->maxStackDepth = maxDepth; return code; } @@ -1578,7 +1585,7 @@ TclCompileSetCmd(interp, parsePtr, envPtr) CompileEnv *envPtr; /* Holds resulting instructions. */ { Tcl_Token *varTokenPtr, *valueTokenPtr; - TYPE (Tcl_Parse) elemParse; + TEMP (Tcl_Parse) elemParse; int gotElemParse = 0; register char *p; char *name, *elName; @@ -1588,7 +1595,7 @@ TclCompileSetCmd(interp, parsePtr, envPtr) int maxDepth = 0; int code = TCL_OK; - NEWSTRUCT (Tcl_Parse,elemParse); + NEWTEMP (Tcl_Parse,elemParse); envPtr->maxStackDepth = 0; numWords = parsePtr->numWords; @@ -1596,7 +1603,7 @@ TclCompileSetCmd(interp, parsePtr, envPtr) Tcl_ResetResult(interp); Tcl_AppendToObj(Tcl_GetObjResult(interp), "wrong # args: should be \"set varName ?newValue?\"", -1); - RELSTRUCT(elemParse); + RELTEMP(elemParse); return TCL_ERROR; } isAssignment = (numWords == 3); @@ -1840,7 +1847,7 @@ TclCompileSetCmd(interp, parsePtr, envPtr) if (gotElemParse) { Tcl_FreeParse(REF (elemParse)); } - RELSTRUCT (elemParse); + RELTEMP (elemParse); envPtr->maxStackDepth = maxDepth; return code; } diff --git a/generic/tclCompExpr.c b/generic/tclCompExpr.c index 5cf492b..5ed1b0d 100644 --- a/generic/tclCompExpr.c +++ b/generic/tclCompExpr.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompExpr.c,v 1.4.6.1 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tclCompExpr.c,v 1.4.6.2 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -230,11 +230,11 @@ TclCompileExpr(interp, script, numBytes, envPtr) CompileEnv *envPtr; /* Holds resulting instructions. */ { ExprInfo info; - TYPE (Tcl_Parse) parse; + TEMP (Tcl_Parse) parse; Tcl_HashEntry *hPtr; int maxDepth, new, i, code; - NEWSTRUCT(Tcl_Parse,parse); + NEWTEMP(Tcl_Parse,parse); /* * If this is the first time we've been called, initialize the table @@ -303,7 +303,7 @@ TclCompileExpr(interp, script, numBytes, envPtr) Tcl_FreeParse(REF (parse)); done: - RELSTRUCT (parse); + RELTEMP (parse); envPtr->maxStackDepth = maxDepth; envPtr->exprIsJustVarRef = info.exprIsJustVarRef; envPtr->exprIsComparison = info.exprIsComparison; diff --git a/generic/tclCompile.c b/generic/tclCompile.c index a716a18..88b1926 100644 --- a/generic/tclCompile.c +++ b/generic/tclCompile.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclCompile.c,v 1.20.2.1.2.1 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tclCompile.c,v 1.20.2.1.2.2 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -289,7 +289,7 @@ TclSetByteCodeFromAny(interp, objPtr, hookProc, clientData) ClientData clientData; /* Hook procedure private data. */ { Interp *iPtr = (Interp *) interp; - TYPE (CompileEnv) compEnv; /* Compilation environment structure + TEMP (CompileEnv) compEnv; /* Compilation environment structure * allocated in frame. */ LiteralTable *localTablePtr; register AuxData *auxDataPtr; @@ -298,7 +298,7 @@ TclSetByteCodeFromAny(interp, objPtr, hookProc, clientData) int length, nested, result; char *string; - NEWSTRUCT(CompileEnv,compEnv); + NEWTEMP(CompileEnv,compEnv); localTablePtr = &(ITEM(compEnv,localLitTable)); if (!traceInitialized) { @@ -383,7 +383,7 @@ TclSetByteCodeFromAny(interp, objPtr, hookProc, clientData) ckfree((char *) localTablePtr->buckets); } TclFreeCompileEnv(REF(compEnv)); - RELSTRUCT(compEnv); + RELTEMP(compEnv); return result; } @@ -755,7 +755,7 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) CompileEnv *envPtr; /* Holds resulting instructions. */ { Interp *iPtr = (Interp *) interp; - TYPE (Tcl_Parse) parse; + TEMP (Tcl_Parse) parse; int maxDepth = 0; /* Maximum number of stack elements needed * to execute all cmds. */ int lastTopLevelCmdIndex = -1; @@ -774,7 +774,7 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) char prev; Tcl_DString ds; - NEWSTRUCT (Tcl_Parse,parse); + NEWTEMP (Tcl_Parse,parse); Tcl_DStringInit(&ds); if (numBytes < 0) { @@ -1013,7 +1013,7 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) iPtr->termOffset = (p - script); } envPtr->maxStackDepth = maxDepth; - RELSTRUCT (parse); + RELTEMP (parse); Tcl_DStringFree(&ds); return TCL_OK; @@ -1045,7 +1045,7 @@ TclCompileScript(interp, script, numBytes, nested, envPtr) if (gotParse) { Tcl_FreeParse(REF(parse)); } - RELSTRUCT (parse); + RELTEMP (parse); iPtr->termOffset = (p - script); envPtr->maxStackDepth = maxDepth; Tcl_DStringFree(&ds); diff --git a/generic/tclExecute.c b/generic/tclExecute.c index 0539d51..1da7be2 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.10.2.2.2.1 2001/12/03 18:23:13 andreas_kupries Exp $ + * RCS: @(#) $Id: tclExecute.c,v 1.10.2.2.2.2 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -5921,7 +5921,7 @@ TclCompileByteCodesForExpr(interp, objPtr) Tcl_Obj *objPtr; { Interp *iPtr = (Interp *) interp; - TYPE (CompileEnv) compEnv; /* Compilation environment structure + TEMP (CompileEnv) compEnv; /* Compilation environment structure * allocated in frame. */ LiteralTable *localTablePtr; register ByteCode *codePtr = NULL; @@ -5932,7 +5932,7 @@ TclCompileByteCodesForExpr(interp, objPtr) char *string; int length, i, result; - NEWSTRUCT(CompileEnv,compEnv); + NEWTEMP(CompileEnv,compEnv); localTablePtr = &(ITEM(compEnv,localLitTable)); string = Tcl_GetStringFromObj(objPtr, &length); @@ -6003,7 +6003,7 @@ TclCompileByteCodesForExpr(interp, objPtr) auxDataPtr++; } TclFreeCompileEnv(REF(compEnv)); - RELSTRUCT(compEnv); + RELTEMP(compEnv); return result; } @@ -6027,7 +6027,7 @@ TclCompileByteCodesForExpr(interp, objPtr) TclEmitOpcode(INST_DONE, REF(compEnv)); TclInitByteCodeObj(objPtr, REF(compEnv)); TclFreeCompileEnv(REF(compEnv)); - RELSTRUCT(compEnv); + RELTEMP(compEnv); codePtr = (ByteCode *) objPtr->internalRep.otherValuePtr; #ifdef TCL_COMPILE_DEBUG if (tclTraceCompile == 2) { diff --git a/generic/tclIO.c b/generic/tclIO.c index 1854ca5..e41aae9 100644 --- a/generic/tclIO.c +++ b/generic/tclIO.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclIO.c,v 1.20.2.12.2.1 2001/11/28 17:58:36 andreas_kupries Exp $ + * RCS: @(#) $Id: tclIO.c,v 1.20.2.12.2.2 2001/12/04 21:52:08 andreas_kupries Exp $ */ #include "tclInt.h" @@ -5498,7 +5498,7 @@ Tcl_BadChannelOption(interp, optionName, optionList) */ { if (interp) { - CONST char *genericopt = + static CONST char *genericopt = "blocking buffering buffersize encoding eofchar translation"; char **argv; int argc, i; diff --git a/generic/tclInt.h b/generic/tclInt.h index f2e5b8d..84c69b8 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclInt.h,v 1.42.2.3 2001/10/19 23:47:57 hobbs Exp $ + * RCS: @(#) $Id: tclInt.h,v 1.42.2.3.2.1 2001/12/04 21:52:09 andreas_kupries Exp $ */ #ifndef _TCLINT @@ -2218,5 +2218,100 @@ extern Tcl_Mutex tclObjMutex; # undef TCL_STORAGE_CLASS # define TCL_STORAGE_CLASS DLLIMPORT +/* The following macros are + * - a clause to activate all macros cutting features out of the core. + * - feature dependencies + */ + +#ifdef MODULAR_TCL +#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ +#define TCL_NO_TTY /* Disable "tty" channel driver */ +#define TCL_NO_PIPES /* Disable "pipe" channel driver */ +#define TCL_NO_PIDCMD /* Disable "pid" command */ +#define TCL_NO_NONSTDCHAN /* Disable creation of channels beyond std* */ +#define TCL_NO_CHANNELCOPY /* Disable channel copying, C/Tcl [fcopy] */ +#define TCL_NO_CHANNEL_READ /* Disable Tcl_ReadChars, [read] */ +#define TCL_NO_CHANNEL_EOF /* Disable [eof] */ +#define TCL_NO_CHANNEL_CONFIG /* Disable [fconfigure] and Tcl_GetChannelOption */ +#define TCL_NO_CHANNEL_BLOCKED /* Disable [fblocked] */ +#define TCL_NO_FILEEVENTS /* Disable [fileevent] and underlying APIs */ +#define TCL_NO_FILESYSTEM /* Disable everything related to the filesystem */ +#define TCL_NO_LOADCMD /* Disable [load] and machinery below */ +#define TCL_NO_SLAVEINTERP /* No slave interp's */ +#define TCL_NO_CMDALIASES /* No command aliases */ +#define TCL_STRUCT_ON_HEAP /* Allocate temp. big structures off the heap */ +#endif + +#ifdef TCL_NO_NONSTDCHAN +#define TCL_NO_SOCKETS /* Disable "tcp" channel driver */ +#define TCL_NO_TTY /* Disable "tty" channel driver */ +#define TCL_NO_PIPES /* Disable "pipe" channel driver */ +#endif + + +#ifdef TCL_STRUCT_ON_HEAP +#define TEMP(t) t * +#define ITEM(var,item) var -> item +#define REF(var) (var) +#define NEWTEMP(t,var) (var) = (t *) Tcl_Alloc(sizeof(t)) +#define RELTEMP(var) Tcl_Free((void*)(var)) +#define STRING(n,var) char* var +#define NEWSTR(n,var) (var) = (char *) Tcl_Alloc(n) +#else +#define TEMP(t) t +#define ITEM(var,item) var . item +#define REF(var) &(var) +#define NEWTEMP(t,var) +#define RELTEMP(var) +#define STRING(n,var) char var [n] +#define NEWSTR(n,var) +#endif + +/* + * Additional macros to control the sizes of various data placed on the stack. + */ + +#ifndef TCL_FMT_STATIC_FLOATBUFFER_SZ +#define TCL_FMT_STATIC_FLOATBUFFER_SZ 320 +#endif +#ifndef TCL_FMT_STATIC_VALIDATE_LIST +#define TCL_FMT_STATIC_VALIDATE_LIST 16 +#endif +#ifndef TCL_FOREACH_STATIC_ARGS +#define TCL_FOREACH_STATIC_ARGS 9 +#endif +#ifndef TCL_FOREACH_STATIC_LIST_SZ +#define TCL_FOREACH_STATIC_LIST_SZ 4 +#endif +#ifndef TCL_FOREACH_STATIC_VARLIST_SZ +#define TCL_FOREACH_STATIC_VARLIST_SZ 5 +#endif +#ifndef TCL_RESULT_APPEND_STATIC_LIST_SZ +#define TCL_RESULT_APPEND_STATIC_LIST_SZ 16 +#endif +#ifndef TCL_MERGE_STATIC_LIST_SZ +#define TCL_MERGE_STATIC_LIST_SZ 20 +#endif +#ifndef TCL_PROC_STATIC_CLOCALS +#define TCL_PROC_STATIC_CLOCALS 20 +#endif +#ifndef TCL_PROC_STATIC_ARGS +#define TCL_PROC_STATIC_ARGS 20 +#endif +#ifndef TCL_INVOKE_STATIC_ARGS +#define TCL_INVOKE_STATIC_ARGS 20 +#endif +#ifndef TCL_EVAL_STATIC_VARCHARS +#define TCL_EVAL_STATIC_VARCHARS 30 +#endif +#ifndef TCL_STATS_COUNTERS +#define TCL_STATS_COUNTERS 10 +#endif +#ifndef TCL_LSORT_STATIC_MERGE_BUCKETS +#define TCL_LSORT_STATIC_MERGE_BUCKETS 30 +#endif + + + #endif /* _TCLINT */ diff --git a/generic/tclParse.c b/generic/tclParse.c index 652e26e..41037ae 100644 --- a/generic/tclParse.c +++ b/generic/tclParse.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: tclParse.c,v 1.13.2.1.2.1 2001/12/03 18:23:14 andreas_kupries Exp $ + * RCS: @(#) $Id: tclParse.c,v 1.13.2.1.2.2 2001/12/04 21:52:09 andreas_kupries Exp $ */ #include "tclInt.h" @@ -540,9 +540,9 @@ ParseTokens(src, mask, parsePtr) int type, originalTokens, varToken; char utfBytes[TCL_UTF_MAX]; Tcl_Token *tokenPtr; - TYPE (Tcl_Parse) nested; + TEMP (Tcl_Parse) nested; - NEWSTRUCT (Tcl_Parse,nested); + NEWTEMP (Tcl_Parse,nested); /* * Each iteration through the following loop adds one token of @@ -589,7 +589,7 @@ ParseTokens(src, mask, parsePtr) varToken = parsePtr->numTokens; if (Tcl_ParseVarName(parsePtr->interp, src, parsePtr->end - src, parsePtr, 1) != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } src += parsePtr->tokenPtr[varToken].size; @@ -607,7 +607,7 @@ ParseTokens(src, mask, parsePtr) parsePtr->errorType = ITEM(nested,errorType); parsePtr->term = ITEM(nested,term); parsePtr->incomplete = ITEM(nested,incomplete); - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } src = ITEM (nested,commandStart) + ITEM (nested,commandSize); @@ -625,7 +625,7 @@ ParseTokens(src, mask, parsePtr) parsePtr->errorType = TCL_PARSE_MISSING_BRACKET; parsePtr->term = tokenPtr->start; parsePtr->incomplete = 1; - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } } @@ -687,7 +687,7 @@ ParseTokens(src, mask, parsePtr) parsePtr->numTokens++; } parsePtr->term = src; - RELSTRUCT(nested); + RELTEMP(nested); return TCL_OK; } @@ -1325,7 +1325,7 @@ Tcl_EvalEx(interp, script, numBytes, flags) { Interp *iPtr = (Interp *) interp; char *p, *next; - TYPE (Tcl_Parse) parse; + TEMP (Tcl_Parse) parse; #define NUM_STATIC_OBJS TCL_INVOKE_STATIC_ARGS Tcl_Obj *staticObjArray[NUM_STATIC_OBJS], **objv; Tcl_Token *tokenPtr; @@ -1339,7 +1339,7 @@ Tcl_EvalEx(interp, script, numBytes, flags) */ int gotParse = 0, objectsUsed = 0; - NEWSTRUCT(Tcl_Parse,parse); + NEWTEMP(Tcl_Parse,parse); if (numBytes < 0) { numBytes = strlen(script); @@ -1430,11 +1430,11 @@ Tcl_EvalEx(interp, script, numBytes, flags) iPtr->termOffset = (p - 1) - script; iPtr->varFramePtr = savedVarFramePtr; - RELSTRUCT(parse); + RELTEMP(parse); return TCL_OK; } } while (bytesLeft > 0); - RELSTRUCT(parse); + RELTEMP(parse); iPtr->termOffset = p - script; iPtr->varFramePtr = savedVarFramePtr; return TCL_OK; @@ -1519,7 +1519,7 @@ Tcl_EvalEx(interp, script, numBytes, flags) if (objv != staticObjArray) { ckfree((char *) objv); } - RELSTRUCT(parse); + RELTEMP(parse); iPtr->varFramePtr = savedVarFramePtr; return code; } @@ -1854,13 +1854,13 @@ Tcl_ParseVar(interp, string, termPtr) * one in the variable specifier. */ { - TYPE (Tcl_Parse) parse; + TEMP (Tcl_Parse) parse; register Tcl_Obj *objPtr; - NEWSTRUCT(Tcl_Parse,parse); + NEWTEMP(Tcl_Parse,parse); if (Tcl_ParseVarName(interp, string, -1, REF(parse), 0) != TCL_OK) { - RELSTRUCT(parse); + RELTEMP(parse); return NULL; } @@ -1872,13 +1872,13 @@ Tcl_ParseVar(interp, string, termPtr) * There isn't a variable name after all: the $ is just a $. */ - RELSTRUCT(parse); + RELTEMP(parse); return "$"; } objPtr = Tcl_EvalTokens(interp, ITEM (parse,tokenPtr), ITEM (parse,numTokens)); if (objPtr == NULL) { - RELSTRUCT(parse); + RELTEMP(parse); return NULL; } @@ -1893,7 +1893,7 @@ Tcl_ParseVar(interp, string, termPtr) } #endif /*TCL_COMPILE_DEBUG*/ TclDecrRefCount(objPtr); - RELSTRUCT(parse); + RELTEMP(parse); return TclGetString(objPtr); } @@ -2218,11 +2218,11 @@ CommandComplete(script, length) char *script; /* Script to check. */ int length; /* Number of bytes in script. */ { - TYPE (Tcl_Parse) parse; + TEMP (Tcl_Parse) parse; char *p, *end; int result; - NEWSTRUCT(Tcl_Parse,parse); + NEWTEMP(Tcl_Parse,parse); p = script; end = p + length; @@ -2240,7 +2240,7 @@ CommandComplete(script, length) result = 1; } Tcl_FreeParse(REF(parse)); - RELSTRUCT(parse); + RELTEMP(parse); return result; } diff --git a/generic/tclParseExpr.c b/generic/tclParseExpr.c index 9b894f4..360c8ee 100644 --- a/generic/tclParseExpr.c +++ b/generic/tclParseExpr.c @@ -11,7 +11,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclParseExpr.c,v 1.6.6.1 2001/12/03 18:23:14 andreas_kupries Exp $ + * RCS: @(#) $Id: tclParseExpr.c,v 1.6.6.2 2001/12/04 21:52:09 andreas_kupries Exp $ */ #include "tclInt.h" @@ -1122,11 +1122,11 @@ ParsePrimaryExpr(infoPtr) Tcl_Parse *parsePtr = infoPtr->parsePtr; Tcl_Interp *interp = parsePtr->interp; Tcl_Token *tokenPtr, *exprTokenPtr; - TYPE (Tcl_Parse) nested; + TEMP (Tcl_Parse) nested; char *dollarPtr, *stringStart, *termPtr, *src; int lexeme, exprIndex, firstIndex, numToMove, code; - NEWSTRUCT(Tcl_Parse,nested); + NEWTEMP(Tcl_Parse,nested); /* * We simply recurse on parenthesized subexpressions. @@ -1137,12 +1137,12 @@ ParsePrimaryExpr(infoPtr) if (lexeme == OPEN_PAREN) { code = GetLexeme(infoPtr); /* skip over the '(' */ if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } code = ParseCondExpr(infoPtr); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } if (infoPtr->lexeme != CLOSE_PAREN) { @@ -1150,10 +1150,10 @@ ParsePrimaryExpr(infoPtr) } code = GetLexeme(infoPtr); /* skip over the ')' */ if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } - RELSTRUCT(nested); + RELTEMP(nested); return TCL_OK; } @@ -1208,7 +1208,7 @@ ParsePrimaryExpr(infoPtr) code = Tcl_ParseVarName(interp, dollarPtr, (infoPtr->lastChar - dollarPtr), parsePtr, 1); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } infoPtr->next = dollarPtr + parsePtr->tokenPtr[firstIndex].size; @@ -1228,7 +1228,7 @@ ParsePrimaryExpr(infoPtr) code = Tcl_ParseQuotedString(interp, infoPtr->start, (infoPtr->lastChar - stringStart), parsePtr, 1, &termPtr); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } infoPtr->next = termPtr; @@ -1289,7 +1289,7 @@ ParsePrimaryExpr(infoPtr) parsePtr->term = ITEM (nested,term); parsePtr->errorType = ITEM (nested,errorType); parsePtr->incomplete = ITEM (nested,incomplete); - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } src = (ITEM (nested,commandStart) + ITEM (nested,commandSize)); @@ -1307,7 +1307,7 @@ ParsePrimaryExpr(infoPtr) parsePtr->term = tokenPtr->start; parsePtr->errorType = TCL_PARSE_MISSING_BRACKET; parsePtr->incomplete = 1; - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } } @@ -1328,7 +1328,7 @@ ParsePrimaryExpr(infoPtr) (infoPtr->lastChar - infoPtr->start), parsePtr, 1, &termPtr); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } infoPtr->next = termPtr; @@ -1380,7 +1380,7 @@ ParsePrimaryExpr(infoPtr) code = GetLexeme(infoPtr); /* skip over function name */ if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } if (infoPtr->lexeme != OPEN_PAREN) { @@ -1388,21 +1388,21 @@ ParsePrimaryExpr(infoPtr) } code = GetLexeme(infoPtr); /* skip over '(' */ if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } while (infoPtr->lexeme != CLOSE_PAREN) { code = ParseCondExpr(infoPtr); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } if (infoPtr->lexeme == COMMA) { code = GetLexeme(infoPtr); /* skip over , */ if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } } else if (infoPtr->lexeme != CLOSE_PAREN) { @@ -1425,16 +1425,16 @@ ParsePrimaryExpr(infoPtr) code = GetLexeme(infoPtr); if (code != TCL_OK) { - RELSTRUCT(nested); + RELTEMP(nested); return code; } parsePtr->term = infoPtr->next; - RELSTRUCT(nested); + RELTEMP(nested); return TCL_OK; syntaxError: LogSyntaxError(infoPtr); - RELSTRUCT(nested); + RELTEMP(nested); return TCL_ERROR; } diff --git a/generic/tclScan.c b/generic/tclScan.c index 4059136..9d5a5cc 100644 --- a/generic/tclScan.c +++ b/generic/tclScan.c @@ -8,7 +8,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclScan.c,v 1.6.2.2.2.1 2001/12/03 18:23:14 andreas_kupries Exp $ + * RCS: @(#) $Id: tclScan.c,v 1.6.2.2.2.2 2001/12/04 21:52:09 andreas_kupries Exp $ */ #include "tclInt.h" @@ -551,13 +551,18 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) Tcl_UniChar ch, sch; Tcl_Obj **objs = NULL, *objPtr = NULL; int flags; - char buf[513]; /* Temporary buffer to hold scanned + +#define BUF_SZ 513 + STRING (BUF_SZ,buf); /* Temporary buffer to hold scanned * number strings before they are * passed to strtoul. */ + NEWSTR (BUF_SZ,buf); + if (objc < 3) { Tcl_WrongNumArgs(interp, 1, objv, "string format ?varName varName ...?"); + RELTEMP (buf); return TCL_ERROR; } @@ -569,6 +574,7 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) */ if (ValidateFormat(interp, format, numVars, &totalVars) == TCL_ERROR) { + RELTEMP (buf); return TCL_ERROR; } @@ -845,8 +851,8 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) * Scan an unsigned or signed integer. */ - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; + if ((width == 0) || (width > BUF_SZ - 1)) { + width = BUF_SZ - 1; } flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_NOZERO; for (end = buf; width > 0; width--) { @@ -978,8 +984,8 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) * Scan a floating point number */ - if ((width == 0) || (width > sizeof(buf) - 1)) { - width = sizeof(buf) - 1; + if ((width == 0) || (width > BUF_SZ - 1)) { + width = BUF_SZ - 1; } flags |= SCAN_SIGNOK | SCAN_NODIGITS | SCAN_PTOK | SCAN_EXPOK; for (end = buf; width > 0; width--) { @@ -1135,5 +1141,7 @@ Tcl_ScanObjCmd(dummy, interp, objc, objv) } Tcl_SetObjResult(interp, objPtr); } + RELTEMP (buf); return code; } +#undef BUF_SZ diff --git a/unix/tclUnixChan.c b/unix/tclUnixChan.c index f0238ff..caaaa4d 100644 --- a/unix/tclUnixChan.c +++ b/unix/tclUnixChan.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclUnixChan.c,v 1.17.2.1.2.1 2001/11/28 17:58:37 andreas_kupries Exp $ + * RCS: @(#) $Id: tclUnixChan.c,v 1.17.2.1.2.2 2001/12/04 21:52:09 andreas_kupries Exp $ */ #include "tclInt.h" /* Internal definitions for Tcl. */ @@ -2678,11 +2678,16 @@ TclUnixWaitForFile(fd, mask, timeout) Tcl_Time abortTime, now; struct timeval blockTime, *timeoutPtr; int index, bit, numFound, result = 0; - fd_mask readyMasks[3*MASK_SIZE]; - /* This array reflects the readable/writable + + struct rdm { + fd_mask m[3*MASK_SIZE]; + }; + TEMP (struct rdm) readyMasks; /* This array reflects the readable/writable * conditions that were found to exist by the * last call to select. */ + NEWTEMP (struct rdm,readyMasks); + /* * If there is a non-zero finite timeout, compute the time when * we give up. @@ -2712,7 +2717,7 @@ TclUnixWaitForFile(fd, mask, timeout) if (fd >= FD_SETSIZE) { panic("TclWaitForFile can't handle file id %d", fd); } - memset((VOID *) readyMasks, 0, 3*MASK_SIZE*sizeof(fd_mask)); + memset((VOID *) & ITEM (readyMasks,m), 0, 3*MASK_SIZE*sizeof(fd_mask)); index = fd/(NBBY*sizeof(fd_mask)); bit = 1 << (fd%(NBBY*sizeof(fd_mask))); @@ -2740,30 +2745,30 @@ TclUnixWaitForFile(fd, mask, timeout) */ if (mask & TCL_READABLE) { - readyMasks[index] |= bit; + ITEM (readyMasks,m)[index] |= bit; } if (mask & TCL_WRITABLE) { - (readyMasks+MASK_SIZE)[index] |= bit; + (ITEM (readyMasks,m)+MASK_SIZE)[index] |= bit; } if (mask & TCL_EXCEPTION) { - (readyMasks+2*(MASK_SIZE))[index] |= bit; + (ITEM (readyMasks,m)+2*(MASK_SIZE))[index] |= bit; } /* * Wait for the event or a timeout. */ - numFound = select(fd+1, (SELECT_MASK *) &readyMasks[0], - (SELECT_MASK *) &readyMasks[MASK_SIZE], - (SELECT_MASK *) &readyMasks[2*MASK_SIZE], timeoutPtr); + numFound = select(fd+1, (SELECT_MASK *) &ITEM (readyMasks,m)[0], + (SELECT_MASK *) &ITEM (readyMasks,m)[MASK_SIZE], + (SELECT_MASK *) &ITEM (readyMasks,m)[2*MASK_SIZE], timeoutPtr); if (numFound == 1) { - if (readyMasks[index] & bit) { + if (ITEM (readyMasks,m)[index] & bit) { result |= TCL_READABLE; } - if ((readyMasks+MASK_SIZE)[index] & bit) { + if ((ITEM (readyMasks,m)+MASK_SIZE)[index] & bit) { result |= TCL_WRITABLE; } - if ((readyMasks+2*(MASK_SIZE))[index] & bit) { + if ((ITEM (readyMasks,m)+2*(MASK_SIZE))[index] & bit) { result |= TCL_EXCEPTION; } result &= mask; @@ -2786,5 +2791,6 @@ TclUnixWaitForFile(fd, mask, timeout) break; } } + RELTEMP (readyMasks); return result; } -- cgit v0.12