From 04b67bac32e5fbc0942a1e15405fa1ca7f0438fe Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 12 Mar 2019 17:35:50 +0300 Subject: Avoid reinitailization of ZTS cache pointer. Initialize it once in TSRM.c --- TSRM/TSRM.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'TSRM') 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); -- cgit v1.2.1