com php-src: converted ext/zlib with static tsrm ls cache: ext/zlib/config.w32 ext/zlib/config0.m4 ext/zlib/php_zlib.h ext/zlib/zlib.c
| From: | Anatol Belski | Date: | Wed, 15 Oct 2014 09:27:20 +0000 |
| Subject: | com php-src: converted ext/zlib with static tsrm ls cache: ext/zlib/config.w32 ext/zlib/config0.m4 ext/zlib/php_zlib.h ext/zlib/zlib.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82315@lists.php.net to get a copy of this message | ||
Commit: 236857cb476f0b83a2bfebac5308b907ecd875b8
Author: Anatol Belski <ab@php.net> Wed, 15 Oct 2014 11:27:20 +0200
Parents: 1fc8220b6516ac6f40d81eb7cee1eefe69c7e4a0
Branches: native-tls
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=236857cb476f0b83a2bfebac5308b907ecd875b8
Log:
converted ext/zlib with static tsrm ls cache
Changed paths:
M ext/zlib/config.w32
M ext/zlib/config0..m4
M ext/zlib/php_zlib.h
M ext/zlib/zlib.c
Diff:
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32
index 000b1cc..1a57aa6 100644
--- a/ext/zlib/config.w32
+++ b/ext/zlib/config.w32
@@ -7,7 +7,7 @@ if (PHP_ZLIB == "yes") {
if (CHECK_LIB("zlib_a.lib;zlib.lib", "zlib", PHP_ZLIB) &&
CHECK_HEADER_ADD_INCLUDE("zlib.h", "CFLAGS", "..\\zlib;" +
php_usual_include_suspects)) {
- EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D
ZLIB_EXPORTS");
+ EXTENSION("zlib", "zlib.c zlib_fopen_wrapper.c zlib_filter.c", null, "/D
ZLIB_EXPORTS /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1");
AC_DEFINE("HAVE_ZLIB", 1, "ZLIB support");
if (!PHP_ZLIB_SHARED) {
diff --git a/ext/zlib/config0.m4 b/ext/zlib/config0.m4
index ebf67cc..ab94c15 100644
--- a/ext/zlib/config0.m4
+++ b/ext/zlib/config0.m4
@@ -9,7 +9,7 @@ PHP_ARG_WITH(zlib-dir,if the location of ZLIB install directory is defined,
[ --with-zlib-dir=<DIR> Define the location of zlib install directory], no, no)
if test "$PHP_ZLIB" != "no" || test "$PHP_ZLIB_DIR" !=
"no"; then
- PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared)
+ PHP_NEW_EXTENSION(zlib, zlib.c zlib_fopen_wrapper.c zlib_filter.c, $ext_shared,,
-DZEND_ENABLE_STATIC_TSRMLS_CACHE=1)
PHP_SUBST(ZLIB_SHARED_LIBADD)
if test "$PHP_ZLIB" != "yes" -a "$PHP_ZLIB" != "no"; then
diff --git a/ext/zlib/php_zlib.h b/ext/zlib/php_zlib.h
index ba829b5..e5c2f37 100644
--- a/ext/zlib/php_zlib.h
+++ b/ext/zlib/php_zlib.h
@@ -68,7 +68,7 @@ extern zend_module_entry php_zlib_module_entry;
#ifdef ZTS
# include "TSRM.h"
-# define ZLIBG(v) TSRMG(zlib_globals_id, zend_zlib_globals *, v)
+# define ZLIBG(v) ZEND_TSRMG(zlib_globals_id, zend_zlib_globals *, v)
#else
# define ZLIBG(v) (zlib_globals.v)
#endif
diff --git a/ext/zlib/zlib.c b/ext/zlib/zlib.c
index 000b96a..0033518 100644
--- a/ext/zlib/zlib.c
+++ b/ext/zlib/zlib.c
@@ -484,7 +484,6 @@ static PHP_FUNCTION(ob_gzhandler)
ZLIBG(ob_gzhandler) = php_zlib_output_handler_context_init(TSRMLS_C);
}
- TSRMLS_SET_CTX(ctx.tsrm_ls);
ctx.op = flags;
ctx.in.data = in_str;
ctx.in.used = in_len;
@@ -724,6 +723,9 @@ PHP_ZLIB_DECODE_FUNC(gzuncompress, PHP_ZLIB_ENCODING_DEFLATE);
/* }}} */
#ifdef COMPILE_DL_ZLIB
+#ifdef ZTS
+TSRMLS_CACHE_DEFINE;
+#endif
ZEND_GET_MODULE(php_zlib)
#endif
@@ -1008,6 +1010,9 @@ static PHP_MINFO_FUNCTION(zlib)
/* {{{ ZEND_MODULE_GLOBALS_CTOR */
static PHP_GINIT_FUNCTION(zlib)
{
+#if defined(COMPILE_DL_ZLIB) && defined(ZTS)
+ TSRMLS_CACHE_UPDATE;
+#endif
zlib_globals->ob_gzhandler = NULL;
zlib_globals->handler_registered = 0;
}