summaryrefslogtreecommitdiffstats
path: root/generic/tclInt.h
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2007-11-09 21:35:16 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2007-11-09 21:35:16 (GMT)
commitb4735e76da5d332e785a396168efb7230a88d8fe (patch)
treeeb56f5290785cb8ac4ee8de28f240ced1a4fe001 /generic/tclInt.h
parent2ebefee1b05df6c41125e6bc8ed768c0cc4f50dc (diff)
downloadtcl-b4735e76da5d332e785a396168efb7230a88d8fe.zip
tcl-b4735e76da5d332e785a396168efb7230a88d8fe.tar.gz
tcl-b4735e76da5d332e785a396168efb7230a88d8fe.tar.bz2
* generic/tclAsync.c:
* generic/tclBasic.c: * generic/tclExecute.c: * generic/tclInt.h: * generic/tclUnixInit.c: * generic/tclUnixPort.h: new fields in interp (ekeko!) to cache TSD data that is accessed at each command invocation, access macros to replace Tcl_AsyncReady and TclpCheckStackSpace by much faster variants [Patch 1829248]
Diffstat (limited to 'generic/tclInt.h')
-rw-r--r--generic/tclInt.h39
1 files changed, 37 insertions, 2 deletions
diff --git a/generic/tclInt.h b/generic/tclInt.h
index 03e14c6..af62562 100644
--- a/generic/tclInt.h
+++ b/generic/tclInt.h
@@ -13,7 +13,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.337 2007/10/27 13:15:58 msofer Exp $
+ * RCS: @(#) $Id: tclInt.h,v 1.338 2007/11/09 21:35:18 msofer Exp $
*/
#ifndef _TCLINT
@@ -1837,17 +1837,51 @@ typedef struct Interp {
Tcl_HashTable varSearches; /* Hashtable holding the start of a variable's
* active searches list; varPtr is the key */
/*
+ * The thread-specific data ekeko: cache pointers or values that
+ * (a) do not change during the thread's lifetime
+ * (b) require access to TSD to determine at runtime
+ * (c) are accessed very often (eg, at each command call)
+ *
+ * Note that these are the same for all interps in the same thread. They
+ * just have to be initialised for the thread's master interp, slaves
+ * inherit the value.
+ *
+ * They are used by the macros defined below.
+ */
+
+ void *allocCache;
+ void *pendingObjDataPtr; /* Pointer to the Cache and PendingObjData
+ * structs for this interp's thread; see
+ * tclObj.c and tclThreadAlloc.c */
+ int *asyncReadyPtr; /* Pointer to the asyncReady indicator for
+ * this interp's thread; see tclAsync.c */
+ int *stackBound; /* Pointer to the limit stack address
+ * allowable for invoking a new command
+ * without "risking" a C-stack overflow;
+ * see TclpCheckStackSpace in the
+ * platform's directory. */
+
+
+#ifdef TCL_COMPILE_STATS
+ /*
* Statistical information about the bytecode compiler and interpreter's
* operation.
*/
-#ifdef TCL_COMPILE_STATS
ByteCodeStats stats; /* Holds compilation and execution statistics
* for this interpreter. */
#endif /* TCL_COMPILE_STATS */
} Interp;
/*
+ * Macros that use the TSD-ekeko
+ */
+
+#define TclAsyncReady(iPtr) \
+ *((iPtr)->asyncReadyPtr)
+
+
+/*
* General list of interpreters. Doubly linked for easier removal of items
* deep in the list.
*/
@@ -2381,6 +2415,7 @@ MODULE_SCOPE double TclFloor(mp_int *a);
MODULE_SCOPE void TclFormatNaN(double value, char *buffer);
MODULE_SCOPE int TclFSFileAttrIndex(Tcl_Obj *pathPtr,
CONST char *attributeName, int *indexPtr);
+MODULE_SCOPE int * TclGetAsyncReadyPtr(void);
MODULE_SCOPE Tcl_Obj * TclGetBgErrorHandler(Tcl_Interp *interp);
MODULE_SCOPE int TclGetNumberFromObj(Tcl_Interp *interp,
Tcl_Obj *objPtr, ClientData *clientDataPtr,