opcache, intl, gmp, exif, com, bcmath to use static tsrmls

This commit is contained in:
Anatol Belski 2014-10-17 15:51:21 +02:00
parent 5749b4a997
commit 4fce2ae2c6
22 changed files with 69 additions and 17 deletions

View File

@ -127,6 +127,9 @@ zend_module_entry bcmath_module_entry = {
}; };
#ifdef COMPILE_DL_BCMATH #ifdef COMPILE_DL_BCMATH
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE;
#endif
ZEND_GET_MODULE(bcmath) ZEND_GET_MODULE(bcmath)
#endif #endif
@ -140,6 +143,9 @@ PHP_INI_END()
*/ */
static PHP_GINIT_FUNCTION(bcmath) static PHP_GINIT_FUNCTION(bcmath)
{ {
#if defined(COMPILE_DL_BCMATH) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
bcmath_globals->bc_precision = 0; bcmath_globals->bc_precision = 0;
bc_init_numbers(TSRMLS_C); bc_init_numbers(TSRMLS_C);
} }

View File

@ -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/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/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, 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) PHP_ADD_BUILD_DIR($ext_builddir/libbcmath/src)
AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath]) AC_DEFINE(HAVE_BCMATH, 1, [Whether you have bcmath])
fi fi

View File

@ -4,7 +4,7 @@
ARG_ENABLE("bcmath", "bc style precision math functions", "yes"); ARG_ENABLE("bcmath", "bc style precision math functions", "yes");
if (PHP_BCMATH == "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 \ 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 \ 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 \ num2long.c output.c recmul.c sqrt.c zero.c debug.c doaddsub.c \

View File

@ -49,7 +49,10 @@ ZEND_BEGIN_MODULE_GLOBALS(bcmath)
ZEND_END_MODULE_GLOBALS(bcmath) ZEND_END_MODULE_GLOBALS(bcmath)
#ifdef ZTS #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 #else
# define BCG(v) (bcmath_globals.v) # define BCG(v) (bcmath_globals.v)
#endif #endif

View File

@ -254,6 +254,9 @@ zend_module_entry com_dotnet_module_entry = {
/* }}} */ /* }}} */
#ifdef COMPILE_DL_COM_DOTNET #ifdef COMPILE_DL_COM_DOTNET
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE;
#endif
ZEND_GET_MODULE(com_dotnet) ZEND_GET_MODULE(com_dotnet)
#endif #endif
@ -337,6 +340,9 @@ PHP_INI_END()
*/ */
static PHP_GINIT_FUNCTION(com_dotnet) 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)); memset(com_dotnet_globals, 0, sizeof(*com_dotnet_globals));
com_dotnet_globals->code_page = CP_ACP; com_dotnet_globals->code_page = CP_ACP;
} }

View File

@ -7,7 +7,8 @@ if (PHP_COM_DOTNET == "yes") {
CHECK_LIB('oleaut32.lib', 'com_dotnet'); CHECK_LIB('oleaut32.lib', 'com_dotnet');
EXTENSION("com_dotnet", "com_com.c com_dotnet.c com_extension.c \ 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_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'); AC_DEFINE('HAVE_COM_DOTNET', 1, 'Have COM_DOTNET support');
CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET'); CHECK_HEADER_ADD_INCLUDE('mscoree.h', 'CFLAGS_COM_DOTNET');
} }

View File

@ -53,7 +53,10 @@ ZEND_BEGIN_MODULE_GLOBALS(com_dotnet)
ZEND_END_MODULE_GLOBALS(com_dotnet) ZEND_END_MODULE_GLOBALS(com_dotnet)
#ifdef ZTS #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 #else
# define COMG(v) (com_dotnet_globals.v) # define COMG(v) (com_dotnet_globals.v)
#endif #endif

View File

@ -7,5 +7,5 @@ PHP_ARG_ENABLE(exif, whether to enable EXIF (metadata from images) support,
if test "$PHP_EXIF" != "no"; then if test "$PHP_EXIF" != "no"; then
AC_DEFINE(HAVE_EXIF, 1, [Whether you want EXIF (metadata from images) support]) 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 fi

View File

@ -5,7 +5,7 @@ ARG_ENABLE("exif", "exif", "no");
if (PHP_EXIF == "yes") { if (PHP_EXIF == "yes") {
if (ADD_EXTENSION_DEP('exif', 'mbstring')) { 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'); AC_DEFINE('HAVE_EXIF', 1, 'Have exif');
} else { } else {
WARNING("exif support can't be enabled, libxml is not enabled") WARNING("exif support can't be enabled, libxml is not enabled")

View File

@ -156,7 +156,10 @@ ZEND_END_MODULE_GLOBALS(exif)
ZEND_DECLARE_MODULE_GLOBALS(exif) ZEND_DECLARE_MODULE_GLOBALS(exif)
#ifdef ZTS #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 #else
#define EXIF_G(v) (exif_globals.v) #define EXIF_G(v) (exif_globals.v)
#endif #endif
@ -208,6 +211,9 @@ PHP_INI_END()
*/ */
static PHP_GINIT_FUNCTION(exif) static PHP_GINIT_FUNCTION(exif)
{ {
#if defined(COMPILE_DL_EXIF) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
exif_globals->encode_unicode = NULL; exif_globals->encode_unicode = NULL;
exif_globals->decode_unicode_be = NULL; exif_globals->decode_unicode_be = NULL;
exif_globals->decode_unicode_le = NULL; exif_globals->decode_unicode_le = NULL;

View File

@ -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_LIBRARY_WITH_PATH(gmp, $GMP_DIR/$PHP_LIBDIR, GMP_SHARED_LIBADD)
PHP_ADD_INCLUDE($GMP_DIR/include) 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) PHP_SUBST(GMP_SHARED_LIBADD)
AC_DEFINE(HAVE_GMP, 1, [ ]) AC_DEFINE(HAVE_GMP, 1, [ ])
fi fi

View File

@ -6,7 +6,7 @@ ARG_WITH("gmp", "Include GNU MP support.", "no");
if (PHP_GMP != "no") { if (PHP_GMP != "no") {
if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) && if (CHECK_LIB("mpir_a.lib", "gmp", PHP_GMP) &&
CHECK_HEADER_ADD_INCLUDE("gmp.h", "CFLAGS_GMP", PHP_GMP + ";" + PHP_PHP_BUILD + "\\include\\mpir")) { 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_GMP', 1, 'GMP support');
AC_DEFINE('HAVE_MPIR', 1, 'MPIR support'); AC_DEFINE('HAVE_MPIR', 1, 'MPIR support');
} else { } else {

View File

@ -209,6 +209,9 @@ zend_module_entry gmp_module_entry = {
/* }}} */ /* }}} */
#ifdef COMPILE_DL_GMP #ifdef COMPILE_DL_GMP
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE;
#endif
ZEND_GET_MODULE(gmp) ZEND_GET_MODULE(gmp)
#endif #endif
@ -649,6 +652,9 @@ exit:
*/ */
static ZEND_GINIT_FUNCTION(gmp) static ZEND_GINIT_FUNCTION(gmp)
{ {
#if defined(COMPILE_DL_GMP) && defined(ZTS)
ZEND_TSRMLS_CACHE_UPDATE;
#endif
gmp_globals->rand_initialized = 0; gmp_globals->rand_initialized = 0;
} }
/* }}} */ /* }}} */

View File

@ -92,7 +92,10 @@ ZEND_BEGIN_MODULE_GLOBALS(gmp)
ZEND_END_MODULE_GLOBALS(gmp) ZEND_END_MODULE_GLOBALS(gmp)
#ifdef ZTS #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 #else
#define GMPG(v) (gmp_globals.v) #define GMPG(v) (gmp_globals.v)
#endif #endif

View File

@ -85,7 +85,7 @@ if test "$PHP_INTL" != "no"; then
breakiterator/codepointiterator_internal.cpp \ breakiterator/codepointiterator_internal.cpp \
breakiterator/codepointiterator_methods.cpp \ breakiterator/codepointiterator_methods.cpp \
idn/idn.c \ 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/collator)
PHP_ADD_BUILD_DIR($ext_builddir/converter) PHP_ADD_BUILD_DIR($ext_builddir/converter)
PHP_ADD_BUILD_DIR($ext_builddir/common) PHP_ADD_BUILD_DIR($ext_builddir/common)

View File

@ -8,7 +8,7 @@ if (PHP_INTL != "no") {
CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) { CHECK_HEADER_ADD_INCLUDE("unicode/utf.h", "CFLAGS_INTL")) {
// always build as shared - zend_strtod.c/ICU type conflict // 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, 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", "\ ADD_SOURCES(configure_module_dirname + "/collator", "\
collator.c \ collator.c \
collator_attr.c \ collator_attr.c \

View File

@ -893,12 +893,18 @@ zend_module_entry intl_module_entry = {
/* }}} */ /* }}} */
#ifdef COMPILE_DL_INTL #ifdef COMPILE_DL_INTL
#ifdef ZTS
ZEND_TSRMLS_CACHE_DEFINE;
#endif
ZEND_GET_MODULE( intl ) ZEND_GET_MODULE( intl )
#endif #endif
/* {{{ intl_init_globals */ /* {{{ intl_init_globals */
static PHP_GINIT_FUNCTION(intl) 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) ); memset( intl_globals, 0, sizeof(zend_intl_globals) );
} }
/* }}} */ /* }}} */

View File

@ -56,7 +56,10 @@ ZEND_END_MODULE_GLOBALS(intl)
/* Macro to access request-wide global variables. */ /* Macro to access request-wide global variables. */
#ifdef ZTS #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 #else
#define INTL_G(v) (intl_globals.v) #define INTL_G(v) (intl_globals.v)
#endif #endif

View File

@ -90,6 +90,9 @@ ZEND_EXTENSION();
zend_accel_globals accel_globals; zend_accel_globals accel_globals;
#else #else
int accel_globals_id; int accel_globals_id;
#if defined(COMPILE_DL_OPCACHE)
ZEND_TSRMLS_CACHE_DEFINE;
#endif
#endif #endif
/* Points to the structure shared across all PHP processes */ /* 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) 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)); 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_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); zend_accel_copy_internal_functions(TSRMLS_C);

View File

@ -285,8 +285,11 @@ extern zend_accel_shared_globals *accel_shared_globals;
#define ZCSG(element) (accel_shared_globals->element) #define ZCSG(element) (accel_shared_globals->element)
#ifdef ZTS #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; extern int accel_globals_id;
# ifdef COMPILE_DL_OPCACHE
ZEND_TSRMLS_CACHE_EXTERN;
# endif
#else #else
# define ZCG(v) (accel_globals.v) # define ZCG(v) (accel_globals.v)
extern zend_accel_globals accel_globals; extern zend_accel_globals accel_globals;

View File

@ -385,7 +385,7 @@ fi
Optimizer/optimize_temp_vars_5.c \ Optimizer/optimize_temp_vars_5.c \
Optimizer/nop_removal.c \ Optimizer/nop_removal.c \
Optimizer/compact_literals.c, Optimizer/compact_literals.c,
shared,,,,yes) shared,,-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,,yes)
PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1) PHP_ADD_BUILD_DIR([$ext_builddir/Optimizer], 1)
fi fi

View File

@ -14,7 +14,7 @@ if (PHP_OPCACHE != "no") {
zend_persist.c \ zend_persist.c \
zend_persist_calc.c \ zend_persist_calc.c \
zend_shared_alloc.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"); 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");