diff options
author | Anatol Belski <ab@php.net> | 2014-10-15 11:27:20 +0200 |
---|---|---|
committer | Anatol Belski <ab@php.net> | 2014-10-15 11:27:20 +0200 |
commit | 236857cb476f0b83a2bfebac5308b907ecd875b8 (patch) | |
tree | e9247df7f9ffe61d8e7b2c63600e3ab612e7d087 | |
parent | 1fc8220b6516ac6f40d81eb7cee1eefe69c7e4a0 (diff) | |
download | php-git-236857cb476f0b83a2bfebac5308b907ecd875b8.tar.gz |
converted ext/zlib with static tsrm ls cache
-rw-r--r-- | ext/zlib/config.w32 | 2 | ||||
-rw-r--r-- | ext/zlib/config0.m4 | 2 | ||||
-rw-r--r-- | ext/zlib/php_zlib.h | 2 | ||||
-rw-r--r-- | ext/zlib/zlib.c | 7 |
4 files changed, 9 insertions, 4 deletions
diff --git a/ext/zlib/config.w32 b/ext/zlib/config.w32 index 000b1ccabb..1a57aa6110 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 ebf67cc001..ab94c15fe0 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 ba829b5888..e5c2f37016 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 000b96ad8e..0033518ae0 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; } |