summaryrefslogtreecommitdiff
path: root/TSRM
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2019-03-12 17:35:50 +0300
committerDmitry Stogov <dmitry@zend.com>2019-03-12 17:35:50 +0300
commit04b67bac32e5fbc0942a1e15405fa1ca7f0438fe (patch)
tree2c302e1a5f3389a813955f2cecd75e1b635e485a /TSRM
parent7139c381f133eff38e1fcebfa29f35119c8648f4 (diff)
downloadphp-git-04b67bac32e5fbc0942a1e15405fa1ca7f0438fe.tar.gz
Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.c
Diffstat (limited to 'TSRM')
-rw-r--r--TSRM/TSRM.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/TSRM/TSRM.c b/TSRM/TSRM.c
index 63ae6efc23..67f6722945 100644
--- a/TSRM/TSRM.c
+++ b/TSRM/TSRM.c
@@ -19,9 +19,8 @@
typedef struct _tsrm_tls_entry tsrm_tls_entry;
-#if defined(TSRM_WIN32)
/* TSRMLS_CACHE_DEFINE; is already done in Zend, this is being always compiled statically. */
-#endif
+TSRMLS_CACHE_EXTERN();
struct _tsrm_tls_entry {
void **storage;
@@ -300,6 +299,7 @@ static void allocate_new_resource(tsrm_tls_entry **thread_resources_ptr, THREAD_
/* Set thread local storage to this new thread resources structure */
tsrm_tls_set(*thread_resources_ptr);
+ TSRMLS_CACHE = *thread_resources_ptr;
if (tsrm_new_thread_begin_handler) {
tsrm_new_thread_begin_handler(thread_id);