diff options
author | Anatol Belski <ab@php.net> | 2014-10-17 15:51:21 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-17 15:51:21 +0200 |
commit | 4fce2ae2c64b61e5ef7cdbdb631b8d5691d1b31f (patch) | |
tree | c1e4941189f82e6575fb57de7b0d047404fd0a38 | |
parent | 5749b4a9979cd3ff85996323bed9adc1bd182f76 (diff) | |
download | php-git-4fce2ae2c64b61e5ef7cdbdb631b8d5691d1b31f.tar.gz |
opcache, intl, gmp, exif, com, bcmath to use static tsrmls
-rw-r--r-- | ext/bcmath/bcmath.c | 6 | ||||
-rw-r--r-- | ext/bcmath/config.m4 | 2 | ||||
-rw-r--r-- | ext/bcmath/config.w32 | 2 | ||||
-rw-r--r-- | ext/bcmath/php_bcmath.h | 5 | ||||
-rw-r--r-- | ext/com_dotnet/com_extension.c | 6 | ||||
-rw-r--r-- | ext/com_dotnet/config.w32 | 3 | ||||
-rw-r--r-- | ext/com_dotnet/php_com_dotnet.h | 5 | ||||
-rw-r--r-- | ext/exif/config.m4 | 2 | ||||
-rw-r--r-- | ext/exif/config.w32 | 2 | ||||
-rw-r--r-- | ext/exif/exif.c | 8 | ||||
-rw-r--r-- | ext/gmp/config.m4 | 2 | ||||
-rw-r--r-- | ext/gmp/config.w32 | 2 | ||||
-rw-r--r-- | ext/gmp/gmp.c | 6 | ||||
-rw-r--r-- | ext/gmp/php_gmp.h | 5 | ||||
-rw-r--r-- | ext/intl/config.m4 | 2 | ||||
-rw-r--r-- | ext/intl/config.w32 | 2 | ||||
-rw-r--r-- | ext/intl/php_intl.c | 6 | ||||
-rw-r--r-- | ext/intl/php_intl.h | 5 | ||||
-rw-r--r-- | ext/opcache/ZendAccelerator.c | 6 | ||||
-rw-r--r-- | ext/opcache/ZendAccelerator.h | 5 | ||||
-rw-r--r-- | ext/opcache/config.m4 | 2 | ||||
-rw-r--r-- | ext/opcache/config.w32 | 2 |
22 files changed, 69 insertions, 17 deletions
diff --git a/ext/bcmath/bcmath.c b/ext/bcmath/bcmath.c index 7ef30cad5e..4f8938a108 100644 --- a/ext/bcmath/bcmath.c +++ b/ext/bcmath/bcmath.c @@ -127,6 +127,9 @@ zend_module_entry bcmath_module_entry = { }; #ifdef COMPILE_DL_BCMATH +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(bcmath) #endif @@ -140,6 +143,9 @@ PHP_INI_END() */ static PHP_GINIT_FUNCTION(bcmath) { +#if defined(COMPILE_DL_BCMATH) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif bcmath_globals->bc_precision = 0; bc_init_numbers(TSRMLS_C); } diff --git a/ext/bcmath/config.m4 b/ext/bcmath/config.m4 index 3a4ad8c3b3..bc126454b4 100644 --- a/ext/bcmath/config.m4 +++ b/ext/bcmath/config.m4 @@ -11,7 +11,7 @@ libbcmath/src/add.c libbcmath/src/div.c libbcmath/src/init.c libbcmath/src/neg.c libbcmath/src/compare.c libbcmath/src/divmod.c libbcmath/src/int2num.c libbcmath/src/num2long.c libbcmath/src/output.c libbcmath/src/recmul.c \ libbcmath/src/sqrt.c libbcmath/src/zero.c libbcmath/src/debug.c libbcmath/src/doaddsub.c libbcmath/src/nearzero.c libbcmath/src/num2str.c libbcmath/src/raise.c \ libbcmath/src/rmzero.c libbcmath/src/str2num.c, - $ext_shared,,-I@ext_srcdir@/libbcmath/src) + $ext_shared,,-I@ext_srcdir@/libbcmath/src -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src) AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath]) fi diff --git a/ext/bcmath/config.w32 b/ext/bcmath/config.w32 index 3579eadfae..3973c10cbf 100644 --- a/ext/bcmath/config.w32 +++ b/ext/bcmath/config.w32 @@ -4,7 +4,7 @@ ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); if (PHP_BCMATH == "yes") { - EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src"); + EXTENSION("bcmath", "bcmath.c", null, "-Iext/bcmath/libbcmath/src /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES("ext/bcmath/libbcmath/src", "add.c div.c init.c neg.c \ outofmem.c raisemod.c rt.c sub.c compare.c divmod.c int2num.c \ num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \ diff --git a/ext/bcmath/php_bcmath.h b/ext/bcmath/php_bcmath.h index 12098cff89..6647894bf0 100644 --- a/ext/bcmath/php_bcmath.h +++ b/ext/bcmath/php_bcmath.h @@ -49,7 +49,10 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath) ZEND_END_MODULE_GLOBALS(bcmath) #ifdef ZTS -# define BCG(v) TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) +# define BCG(v) ZEND_TSRMG(bcmath_globals_id, zend_bcmath_globals *, v) +# ifdef COMPILE_DL_BCMATH +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else # define BCG(v) (bcmath_globals.v) #endif diff --git a/ext/com_dotnet/com_extension.c b/ext/com_dotnet/com_extension.c index f66119842e..ce1fa744dd 100644 --- a/ext/com_dotnet/com_extension.c +++ b/ext/com_dotnet/com_extension.c @@ -254,6 +254,9 @@ zend_module_entry com_dotnet_module_entry = { /* }}} */ #ifdef COMPILE_DL_COM_DOTNET +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(com_dotnet) #endif @@ -337,6 +340,9 @@ PHP_INI_END() */ static PHP_GINIT_FUNCTION(com_dotnet) { +#if defined(COMPILE_DL_COM_DOTNET) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals)); com_dotnet_globals->code_page = CP_ACP; } diff --git a/ext/com_dotnet/config.w32 b/ext/com_dotnet/config.w32 index 1526392c24..3ae2328427 100644 --- a/ext/com_dotnet/config.w32 +++ b/ext/com_dotnet/config.w32 @@ -7,7 +7,8 @@ if (PHP_COM_DOTNET == "yes") { CHECK_LIB('oleaut32.lib', 'com_dotnet'); EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \ com_handlers.c com_iterator.c com_misc.c com_olechar.c \ - com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c"); + com_typeinfo.c com_variant.c com_wrapper.c com_saproxy.c com_persist.c", + null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support'); CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET'); } diff --git a/ext/com_dotnet/php_com_dotnet.h b/ext/com_dotnet/php_com_dotnet.h index cb60083289..5066a044ff 100644 --- a/ext/com_dotnet/php_com_dotnet.h +++ b/ext/com_dotnet/php_com_dotnet.h @@ -53,7 +53,10 @@ ZEND_BEGIN_MODULE_GLOBALS(com_dotnet) ZEND_END_MODULE_GLOBALS(com_dotnet) #ifdef ZTS -# define COMG(v) TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v) +# define COMG(v) ZEND_TSRMG(com_dotnet_globals_id, zend_com_dotnet_globals *, v) +# ifdef COMPILE_DL_COM_DOTNET +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else # define COMG(v) (com_dotnet_globals.v) #endif diff --git a/ext/exif/config.m4 b/ext/exif/config.m4 index a3ba9240df..8a3a0d43c2 100644 --- a/ext/exif/config.m4 +++ b/ext/exif/config.m4 @@ -7,5 +7,5 @@ PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support, if test "$PHP_EXIF" != "no"; then AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support]) - PHP_NEW_EXTENSION(exif, exif.c, $ext_shared) + PHP_NEW_EXTENSION(exif, exif.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) fi diff --git a/ext/exif/config.w32 b/ext/exif/config.w32 index 38466c809c..595e71bda0 100644 --- a/ext/exif/config.w32 +++ b/ext/exif/config.w32 @@ -5,7 +5,7 @@ ARG_ENABLE("exif", "exif", "no"); if (PHP_EXIF == "yes") { if (ADD_EXTENSION_DEP('exif', 'mbstring')) { - EXTENSION("exif", "exif.c"); + EXTENSION("exif", "exif.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_EXIF', 1, 'Have exif'); } else { WARNING("exif support can't be enabled, libxml is not enabled") diff --git a/ext/exif/exif.c b/ext/exif/exif.c index 06e1dae41a..5d00672c5c 100644 --- a/ext/exif/exif.c +++ b/ext/exif/exif.c @@ -156,7 +156,10 @@ ZEND_END_MODULE_GLOBALS(exif) ZEND_DECLARE_MODULE_GLOBALS(exif) #ifdef ZTS -#define EXIF_G(v) TSRMG(exif_globals_id, zend_exif_globals *, v) +#define EXIF_G(v) ZEND_TSRMG(exif_globals_id, zend_exif_globals *, v) +#ifdef COMPILE_DL_EXIF +ZEND_TSRMLS_CACHE_DEFINE; +#endif #else #define EXIF_G(v) (exif_globals.v) #endif @@ -208,6 +211,9 @@ PHP_INI_END() */ static PHP_GINIT_FUNCTION(exif) { +#if defined(COMPILE_DL_EXIF) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif exif_globals->encode_unicode = NULL; exif_globals->decode_unicode_be = NULL; exif_globals->decode_unicode_le = NULL; diff --git a/ext/gmp/config.m4 b/ext/gmp/config.m4 index 0388d548cf..8265fb8dfa 100644 --- a/ext/gmp/config.m4 +++ b/ext/gmp/config.m4 @@ -21,7 +21,7 @@ if test "$PHP_GMP" != "no"; then PHP_ADD_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD) PHP_ADD_INCLUDE($GMP_DIR/include) - PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared) + PHP_NEW_EXTENSION(gmp, gmp.c, $ext_shared,, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_SUBST(GMP_SHARED_LIBADD) AC_DEFINE(HAVE_GMP, 1, [ ]) fi diff --git a/ext/gmp/config.w32 b/ext/gmp/config.w32 index 8c863f9bc8..7ea36150b2 100644 --- a/ext/gmp/config.w32 +++ b/ext/gmp/config.w32 @@ -6,7 +6,7 @@ ARG_WITH("gmp", "Include GNU MP support.", "no"); if (PHP_GMP != "no") { if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) && CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) { - EXTENSION("gmp", "gmp.c"); + EXTENSION("gmp", "gmp.c", null, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_GMP', 1, 'GMP support'); AC_DEFINE('HAVE_MPIR', 1, 'MPIR support'); } else { diff --git a/ext/gmp/gmp.c b/ext/gmp/gmp.c index de294049c4..926fc30e8b 100644 --- a/ext/gmp/gmp.c +++ b/ext/gmp/gmp.c @@ -209,6 +209,9 @@ zend_module_entry gmp_module_entry = { /* }}} */ #ifdef COMPILE_DL_GMP +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(gmp) #endif @@ -649,6 +652,9 @@ exit: */ static ZEND_GINIT_FUNCTION(gmp) { +#if defined(COMPILE_DL_GMP) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif gmp_globals->rand_initialized = 0; } /* }}} */ diff --git a/ext/gmp/php_gmp.h b/ext/gmp/php_gmp.h index f9bc0f3269..7e8e51b291 100644 --- a/ext/gmp/php_gmp.h +++ b/ext/gmp/php_gmp.h @@ -92,7 +92,10 @@ ZEND_BEGIN_MODULE_GLOBALS(gmp) ZEND_END_MODULE_GLOBALS(gmp) #ifdef ZTS -#define GMPG(v) TSRMG(gmp_globals_id, zend_gmp_globals *, v) +#define GMPG(v) ZEND_TSRMG(gmp_globals_id, zend_gmp_globals *, v) +#ifdef COMPILE_DL_GMP +ZEND_TSRMLS_CACHE_EXTERN; +#endif #else #define GMPG(v) (gmp_globals.v) #endif diff --git a/ext/intl/config.m4 b/ext/intl/config.m4 index 5afee4809e..0fbbd0f786 100644 --- a/ext/intl/config.m4 +++ b/ext/intl/config.m4 @@ -85,7 +85,7 @@ if test "$PHP_INTL" != "no"; then breakiterator/codepointiterator_internal.cpp \ breakiterator/codepointiterator_methods.cpp \ idn/idn.c \ - $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS) + $icu_spoof_src, $ext_shared,,$ICU_INCS -Wno-write-strings -D__STDC_LIMIT_MACROS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) PHP_ADD_BUILD_DIR($ext_builddir/collator) PHP_ADD_BUILD_DIR($ext_builddir/converter) PHP_ADD_BUILD_DIR($ext_builddir/common) diff --git a/ext/intl/config.w32 b/ext/intl/config.w32 index 22cde6bd6d..4628e434f7 100644 --- a/ext/intl/config.w32 +++ b/ext/intl/config.w32 @@ -8,7 +8,7 @@ if (PHP_INTL != "no") { CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) { // always build as shared - zend_strtod.c/ICU type conflict EXTENSION("intl", "php_intl.c intl_convert.c intl_convertcpp.cpp intl_error.c ", true, - "/I \"" + configure_module_dirname + "\""); + "/I \"" + configure_module_dirname + "\" /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES(configure_module_dirname + "/collator", "\ collator.c \ collator_attr.c \ diff --git a/ext/intl/php_intl.c b/ext/intl/php_intl.c index 2c5e74809d..15f058d2b4 100644 --- a/ext/intl/php_intl.c +++ b/ext/intl/php_intl.c @@ -893,12 +893,18 @@ zend_module_entry intl_module_entry = { /* }}} */ #ifdef COMPILE_DL_INTL +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE( intl ) #endif /* {{{ intl_init_globals */ static PHP_GINIT_FUNCTION(intl) { +#if defined(COMPILE_DL_INTL) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif memset( intl_globals, 0, sizeof(zend_intl_globals) ); } /* }}} */ diff --git a/ext/intl/php_intl.h b/ext/intl/php_intl.h index 3625c4fdcc..265cdb7b9e 100644 --- a/ext/intl/php_intl.h +++ b/ext/intl/php_intl.h @@ -56,7 +56,10 @@ ZEND_END_MODULE_GLOBALS(intl) /* Macro to access request-wide global variables. */ #ifdef ZTS -#define INTL_G(v) TSRMG(intl_globals_id, zend_intl_globals *, v) +#define INTL_G(v) ZEND_TSRMG(intl_globals_id, zend_intl_globals *, v) +#ifdef COMPILE_DL_INTL +ZEND_TSRMLS_CACHE_EXTERN; +#endif #else #define INTL_G(v) (intl_globals.v) #endif diff --git a/ext/opcache/ZendAccelerator.c b/ext/opcache/ZendAccelerator.c index d36827bde6..4650dc286b 100644 --- a/ext/opcache/ZendAccelerator.c +++ b/ext/opcache/ZendAccelerator.c @@ -90,6 +90,9 @@ ZEND_EXTENSION(); zend_accel_globals accel_globals; #else int accel_globals_id; +#if defined(COMPILE_DL_OPCACHE) +ZEND_TSRMLS_CACHE_DEFINE; +#endif #endif /* Points to the structure shared across all PHP processes */ @@ -2243,6 +2246,9 @@ static int zend_accel_init_shm(TSRMLS_D) static void accel_globals_ctor(zend_accel_globals *accel_globals TSRMLS_DC) { +#if defined(COMPILE_DL_OPCACHE) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif memset(accel_globals, 0, sizeof(zend_accel_globals)); zend_hash_init(&accel_globals->function_table, zend_hash_num_elements(CG(function_table)), NULL, ZEND_FUNCTION_DTOR, 1); zend_accel_copy_internal_functions(TSRMLS_C); diff --git a/ext/opcache/ZendAccelerator.h b/ext/opcache/ZendAccelerator.h index 28c3d21102..066c957e9f 100644 --- a/ext/opcache/ZendAccelerator.h +++ b/ext/opcache/ZendAccelerator.h @@ -285,8 +285,11 @@ extern zend_accel_shared_globals *accel_shared_globals; #define ZCSG(element) (accel_shared_globals->element) #ifdef ZTS -# define ZCG(v) TSRMG(accel_globals_id, zend_accel_globals *, v) +# define ZCG(v) ZEND_TSRMG(accel_globals_id, zend_accel_globals *, v) extern int accel_globals_id; +# ifdef COMPILE_DL_OPCACHE +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else # define ZCG(v) (accel_globals.v) extern zend_accel_globals accel_globals; diff --git a/ext/opcache/config.m4 b/ext/opcache/config.m4 index 793105b966..be2f0feab7 100644 --- a/ext/opcache/config.m4 +++ b/ext/opcache/config.m4 @@ -385,7 +385,7 @@ fi Optimizer/optimize_temp_vars_5.c \ Optimizer/nop_removal.c \ Optimizer/compact_literals.c, - shared,,,,yes) + shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes) PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1) fi diff --git a/ext/opcache/config.w32 b/ext/opcache/config.w32 index 9a0713d608..921f0ed9b4 100644 --- a/ext/opcache/config.w32 +++ b/ext/opcache/config.w32 @@ -14,7 +14,7 @@ if (PHP_OPCACHE != "no") { zend_persist.c \ zend_persist_calc.c \ zend_shared_alloc.c \ - shared_alloc_win32.c", true); + shared_alloc_win32.c", true, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES(configure_module_dirname + "/Optimizer", "zend_optimizer.c pass1_5.c pass2.c pass3.c optimize_func_calls.c block_pass.c optimize_temp_vars_5.c nop_removal.c compact_literals.c", "opcache", "OptimizerObj"); |