diff options
author | Kevin B Kenny <kennykb@acm.org> | 2015-10-21 23:30:41 (GMT) |
---|---|---|
committer | Kevin B Kenny <kennykb@acm.org> | 2015-10-21 23:30:41 (GMT) |
commit | f82f46df1628c6703ad0ff2b94d83c6c9a46c56f (patch) | |
tree | cd72f2c405b20397c8c5627e59888bd8ab5983b2 /generic | |
parent | 0a228666ae8b3189ae92ff7624263de1455c24ff (diff) | |
download | tcl-f82f46df1628c6703ad0ff2b94d83c6c9a46c56f.zip tcl-f82f46df1628c6703ad0ff2b94d83c6c9a46c56f.tar.gz tcl-f82f46df1628c6703ad0ff2b94d83c6c9a46c56f.tar.bz2 |
Micro-optimization: remove double checked lock from TclGetAllocCache in favour of initialization in TclInitSubsystems
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclEvent.c | 3 | ||||
-rw-r--r-- | generic/tclInt.h | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/generic/tclEvent.c b/generic/tclEvent.c index 8305410..d62850b 100644 --- a/generic/tclEvent.c +++ b/generic/tclEvent.c @@ -1043,6 +1043,9 @@ TclInitSubsystems(void) #if USE_TCLALLOC TclInitAlloc(); /* Process wide mutex init */ #endif +#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) + TclpInitThreadAlloc(); +#endif #ifdef TCL_MEM_DEBUG TclInitDbCkalloc(); /* Process wide mutex init */ #endif diff --git a/generic/tclInt.h b/generic/tclInt.h index 356d250..d4baed4 100644 --- a/generic/tclInt.h +++ b/generic/tclInt.h @@ -3146,6 +3146,9 @@ MODULE_SCOPE int TclpLoadMemory(Tcl_Interp *interp, void *buffer, Tcl_FSUnloadFileProc **unloadProcPtr, int flags); #endif MODULE_SCOPE void TclInitThreadStorage(void); +#if defined(TCL_THREADS) && defined(USE_THREAD_ALLOC) +MODULE_SCOPE void TclpInitThreadAlloc(void); +#endif MODULE_SCOPE void TclFinalizeThreadDataThread(void); MODULE_SCOPE void TclFinalizeThreadStorage(void); #ifdef TCL_WIDE_CLICKS |