Switch to use ZTS cache

This commit is contained in:
Dmitry Stogov 2019-03-12 14:15:47 +03:00
parent 5aa1176238
commit f1b306fe11
24 changed files with 84 additions and 47 deletions

View file

@ -55,11 +55,7 @@ ZEND_BEGIN_MODULE_GLOBALS(recode)
RECODE_OUTER outer;
ZEND_END_MODULE_GLOBALS(recode)
#ifdef ZTS
# define ReSG(v) TSRMG(recode_globals_id, zend_recode_globals *, v)
#else
# define ReSG(v) (recode_globals.v)
#endif
#define ReSG(v) ZEND_MODULE_GLOBALS_ACCESSOR(recode, v)
ZEND_DECLARE_MODULE_GLOBALS(recode)
static PHP_GINIT_FUNCTION(recode);
@ -103,11 +99,17 @@ zend_module_entry recode_module_entry = {
};
#ifdef COMPILE_DL_RECODE
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE()
#endif
ZEND_GET_MODULE(recode)
#endif
static PHP_GINIT_FUNCTION(recode)
{
#if defined(COMPILE_DL_RECODE) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE();
#endif
recode_globals->outer = NULL;
}