com php-src: more exts converted for static tsrm ls pointer: ext/mbstring/config.m4 ext/mbstring/config.w32 ext/mbstring/mbstring.c
ext/mbstring/mbstring.h ext/pcre/config.w32 ext/pcre/config0.m4 ext/pcre/php_pcre.h ext/reflection/config.m4 ext/re flection/config.w32
ext/reflection/php_reflection.c
| From: | Anatol Belski | Date: | Wed, 15 Oct 2014 17:19:23 +0000 |
| Subject: | com php-src: more exts converted for static tsrm ls pointer: ext/mbstring/config.m4 ext/mbstring/config.w32 ext/mbstring/mbstring.c ext/mbstring/mbstring.h ext/pcre/config.w32 ext/pcre/config0.m4 ext/pcre/php_pcre.h ext/reflection/config.m4 ext/re flection/config.w32 ext/reflection/php_reflection.c |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82373@lists.php.net to get a copy of this message | ||
Commit: 0490a322490ecf19aa428d2790a95db7ac953e00
Author: Anatol Belski <ab@php.net> Wed, 15 Oct 2014 19:19:23 +0200
Parents: 5747327775517b331448ef2094ec83ef08fcc54c
Branches: native-tls
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=0490a322490ecf19aa428d2790a95db7ac953e00
Log:
more exts converted for static tsrm ls pointer
mbstring, pcre, reflection
Changed paths:
M ext/mbstring/config.m4
M ext/mbstring/config.w32
M ext/mbstring/mbstring.c
M ext/mbstring/mbstring.h
M ext/pcre/config.w32
M ext/pcre/config0.m4
M ext/pcre/php_pcre.h
M ext/reflection/config.m4
M ext/reflection/config.w32
M ext/reflection/php_reflection.c
Diff:
diff --git a/ext/mbstring/config.m4 b/ext/mbstring/config.m4
index 25bf238..c7ae3f9 100644
--- a/ext/mbstring/config.m4
+++ b/ext/mbstring/config.m4
@@ -47,7 +47,7 @@ AC_DEFUN([PHP_MBSTRING_EXTENSION], [
PHP_ADD_SOURCES(PHP_EXT_DIR(mbstring), $PHP_MBSTRING_BASE_SOURCES)
out="php_config.h"
else
-
PHP_ADD_SOURCES_X(PHP_EXT_DIR(mbstring),$PHP_MBSTRING_BASE_SOURCES,,shared_objects_mbstring,yes)
+ PHP_ADD_SOURCES_X(PHP_EXT_DIR(mbstring),$PHP_MBSTRING_BASE_SOURCES,
-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1,shared_objects_mbstring,yes)
if test -f "$ext_builddir/config.h.in"; then
out="$abs_builddir/config.h"
else
diff --git a/ext/mbstring/config.w32 b/ext/mbstring/config.w32
index 6b7e05a..27a8143 100644
--- a/ext/mbstring/config.w32
+++ b/ext/mbstring/config.w32
@@ -16,7 +16,7 @@ if (PHP_MBSTRING != "no") {
"-Iext/mbstring/libmbfl -Iext/mbstring/libmbfl/mbfl \
-Iext/mbstring/oniguruma /D NOT_RUBY=1 /D LIBMBFL_EXPORTS=1 \
/D HAVE_STDARG_PROTOTYPES=1 /D HAVE_CONFIG_H /D HAVE_STDLIB_H \
- /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT");
+ /D HAVE_STRICMP /D MBFL_DLL_EXPORT=1 /D EXPORT /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/mbstring/libmbfl/filters", "html_entities.c \
mbfilter_7bit.c mbfilter_ascii.c mbfilter_base64.c mbfilter_big5.c \
diff --git a/ext/mbstring/mbstring.c b/ext/mbstring/mbstring.c
index 691391a..4cc7342 100644
--- a/ext/mbstring/mbstring.c
+++ b/ext/mbstring/mbstring.c
@@ -597,6 +597,9 @@ static sapi_post_entry php_post_entries[] = {
/* }}} */
#ifdef COMPILE_DL_MBSTRING
+#ifdef ZTS
+ZEND_TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(mbstring)
#endif
@@ -1491,6 +1494,10 @@ PHP_INI_END()
/* {{{ module global initialize handler */
static PHP_GINIT_FUNCTION(mbstring)
{
+#if defined(COMPILE_DL_MBSTRING) && defined(ZTS)
+ZEND_TSRMLS_CACHE_UPDATE;
+#endif
+
mbstring_globals->language = mbfl_no_language_uni;
mbstring_globals->internal_encoding = NULL;
mbstring_globals->current_internal_encoding = mbstring_globals->internal_encoding;
diff --git a/ext/mbstring/mbstring.h b/ext/mbstring/mbstring.h
index 0136f8e..bc6434f 100644
--- a/ext/mbstring/mbstring.h
+++ b/ext/mbstring/mbstring.h
@@ -200,7 +200,8 @@ struct mb_overload_def {
};
#ifdef ZTS
-#define MBSTRG(v) TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+#define MBSTRG(v) ZEND_TSRMG(mbstring_globals_id, zend_mbstring_globals *, v)
+ZEND_TSRMLS_CACHE_EXTERN;
#else
#define MBSTRG(v) (mbstring_globals.v)
#endif
diff --git a/ext/pcre/config.w32 b/ext/pcre/config.w32
index 594b1cb..1fe4b68 100644
--- a/ext/pcre/config.w32
+++ b/ext/pcre/config.w32
@@ -2,7 +2,7 @@
// vim:ft=javascript
EXTENSION("pcre", "php_pcre.c", false /* never shared */,
- "-Iext/pcre/pcrelib");
+ "-Iext/pcre/pcrelib -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
ADD_SOURCES("ext/pcre/pcrelib", "pcre_chartables.c pcre_ucd.c pcre_compile.c
pcre_config.c pcre_exec.c pcre_fullinfo.c pcre_get.c pcre_globals.c pcre_maketables.c pcre_newline.c
pcre_ord2utf8.c pcre_refcount.c pcre_study.c pcre_tables.c pcre_valid_utf8.c pcre_version.c
pcre_xclass.c pcre_jit_compile.c", "pcre");
ADD_DEF_FILE("ext\\pcre\\php_pcre.def");
diff --git a/ext/pcre/config0.m4 b/ext/pcre/config0.m4
index bfe2009..3c0875f 100644
--- a/ext/pcre/config0.m4
+++ b/ext/pcre/config0.m4
@@ -47,7 +47,7 @@ PHP_ARG_WITH(pcre-regex,,
AC_DEFINE(HAVE_PCRE, 1, [ ])
PHP_ADD_INCLUDE($PCRE_INCDIR)
- PHP_NEW_EXTENSION(pcre, php_pcre.c, no)
+ PHP_NEW_EXTENSION(pcre, php_pcre.c, no, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h])
else
AC_MSG_CHECKING([for PCRE library to use])
@@ -60,7 +60,7 @@ PHP_ARG_WITH(pcre-regex,,
pcrelib/pcre_tables.c pcrelib/pcre_valid_utf8.c \
pcrelib/pcre_version.c pcrelib/pcre_xclass..c \
pcrelib/pcre_jit_compile.c"
- PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib"
+ PHP_PCRE_CFLAGS="-DHAVE_CONFIG_H -I@ext_srcdir@/pcrelib
-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"
PHP_NEW_EXTENSION(pcre, $pcrelib_sources php_pcre.c, no,,$PHP_PCRE_CFLAGS)
PHP_ADD_BUILD_DIR($ext_builddir/pcrelib)
PHP_INSTALL_HEADERS([ext/pcre], [php_pcre.h pcrelib/])
diff --git a/ext/pcre/php_pcre.h b/ext/pcre/php_pcre.h
index cd66213..a7d69ad 100644
--- a/ext/pcre/php_pcre.h
+++ b/ext/pcre/php_pcre.h
@@ -79,7 +79,7 @@ ZEND_BEGIN_MODULE_GLOBALS(pcre)
ZEND_END_MODULE_GLOBALS(pcre)
#ifdef ZTS
-# define PCRE_G(v) TSRMG(pcre_globals_id, zend_pcre_globals *, v)
+# define PCRE_G(v) ZEND_TSRMG(pcre_globals_id, zend_pcre_globals *, v)
#else
# define PCRE_G(v) (pcre_globals.v)
#endif
diff --git a/ext/reflection/config.m4 b/ext/reflection/config.m4
index 7026636..334d7dc 100755
--- a/ext/reflection/config.m4
+++ b/ext/reflection/config.m4
@@ -2,4 +2,4 @@ dnl $Id$
dnl config.m4 for extension reflection
AC_DEFINE(HAVE_REFLECTION, 1, [Whether Reflection is enabled])
-PHP_NEW_EXTENSION(reflection, php_reflection.c, no)
+PHP_NEW_EXTENSION(reflection, php_reflection.c, no, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
diff --git a/ext/reflection/config.w32 b/ext/reflection/config.w32
index 724bf7b..2eb33c6 100755
--- a/ext/reflection/config.w32
+++ b/ext/reflection/config.w32
@@ -1,6 +1,6 @@
// $Id$
// vim:ft=javascript
-EXTENSION("reflection", "php_reflection.c", false /* never shared */);
+EXTENSION("reflection", "php_reflection.c", false /* never shared */,
"/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE('HAVE_REFLECTION', 1, 'Reflection support enabled');
-PHP_REFLECTION="yes";
\ No newline at end of file
+PHP_REFLECTION="yes";
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c
index 57e1194..73da5c0 100644
--- a/ext/reflection/php_reflection.c
+++ b/ext/reflection/php_reflection.c
@@ -70,7 +70,7 @@ ZEND_END_MODULE_GLOBALS(reflection)
#ifdef ZTS
# define REFLECTION_G(v) \
- TSRMG(reflection_globals_id, zend_reflection_globals*, v)
+ ZEND_TSRMG(reflection_globals_id, zend_reflection_globals*, v)
extern int reflection_globals_id;
#else
# define REFLECTION_G(v) (reflection_globals.v)