com php-src: converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usage: ext/ereg/config.w32 ext/ereg/config0.m4 ext/ereg/php_e reg.h
ext/pgsql/config.m4 ext/pgsql/config.w32 ext/pgsql/pgsql.c ext/pgsql/php_pgsql.h ext/phar/c onfig.m4 ext/phar/config.w32 ext/phar/phar.c
ext/phar/phar_internal.h

From: Date: Thu, 16 Oct 2014 11:47:43 +0000
Subject: com php-src: converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usage: ext/ereg/config.w32 ext/ereg/config0.m4 ext/ereg/php_e reg.h
ext/pgsql/config.m4 ext/pgsql/config.w32 ext/pgsql/pgsql.c ext/pgsql/php_pgsql.h ext/phar/c onfig.m4 ext/phar/config.w32 ext/phar/phar.c
ext/phar/phar_internal.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-82375@lists.php.net to get a copy of this message
Commit: 7f1107de9167ab1443a13491f5b70aa3f10fd323 Author: Anatol Belski <ab@php.net> Thu, 16 Oct 2014 13:47:43 +0200 Parents: 0e7682c63c10e374d76a4f93974f7e64716cf234 Branches: native-tls Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7f1107de9167ab1443a13491f5b70aa3f10fd323 Log: converted ext/ereg, ext/phar and ext/pgsql for static tsrmls usage Changed paths: M ext/ereg/config.w32 M ext/ereg/config0.m4 M ext/ereg/php_ereg.h M ext/pgsql/config.m4 M ext/pgsql/config.w32 M ext/pgsql/pgsql.c M ext/pgsql/php_pgsql.h M ext/phar/config.m4 M ext/phar/config.w32 M ext/phar/phar.c M ext/phar/phar_internal.h Diff: diff --git a/ext/ereg/config.w32 b/ext/ereg/config.w32 index 18a002b..887fb0e 100644 --- a/ext/ereg/config.w32 +++ b/ext/ereg/config.w32 @@ -4,7 +4,7 @@ ARG_WITH("ereg", "POSIX extended regular expressions", "yes"); if (PHP_EREG != "no") { - EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex"); + EXTENSION("ereg", "ereg.c", PHP_EREG_SHARED, "-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp -Iext/ereg/regex /DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); ADD_SOURCES("ext/ereg/regex", "regcomp.c regexec.c regerror.c regfree.c", "ereg"); AC_DEFINE('REGEX', 1, 'Bundled regex'); AC_DEFINE('HSREGEX', 1, 'Bundled regex'); diff --git a/ext/ereg/config0.m4 b/ext/ereg/config0.m4 index caec39d..2089f24 100644 --- a/ext/ereg/config0.m4 +++ b/ext/ereg/config0.m4 @@ -33,6 +33,7 @@ if test "$REGEX_TYPE" = "php"; then ereg_regex_headers="regex/" PHP_EREG_CFLAGS="-Dregexec=php_regexec -Dregerror=php_regerror -Dregfree=php_regfree -Dregcomp=php_regcomp" fi +PHP_EREG_CFLAGS="$PHP_EREG_CFLAGS -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1" PHP_NEW_EXTENSION(ereg, ereg.c $ereg_regex_sources, no,,$PHP_EREG_CFLAGS) PHP_INSTALL_HEADERS([ext/ereg], [php_ereg.h php_regex.h $ereg_regex_headers]) diff --git a/ext/ereg/php_ereg.h b/ext/ereg/php_ereg.h index f1c2676..a1081e2 100644 --- a/ext/ereg/php_ereg.h +++ b/ext/ereg/php_ereg.h @@ -54,7 +54,7 @@ ZEND_END_MODULE_GLOBALS(ereg) PHP_MINFO_FUNCTION(ereg); #ifdef ZTS -#define EREG(v) TSRMG(ereg_globals_id, zend_ereg_globals *, v) +#define EREG(v) ZEND_TSRMG(ereg_globals_id, zend_ereg_globals *, v) #else #define EREG(v) (ereg_globals.v) #endif diff --git a/ext/pgsql/config.m4 b/ext/pgsql/config.m4 index 1864698..bd3470e 100644 --- a/ext/pgsql/config.m4 +++ b/ext/pgsql/config.m4 @@ -105,7 +105,7 @@ if test "$PHP_PGSQL" != "no"; then PHP_ADD_INCLUDE($PGSQL_INCLUDE) - PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared) + PHP_NEW_EXTENSION(pgsql, pgsql.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) fi diff --git a/ext/pgsql/config.w32 b/ext/pgsql/config.w32 index d38048d..5775dfa 100644 --- a/ext/pgsql/config.w32 +++ b/ext/pgsql/config.w32 @@ -6,7 +6,7 @@ ARG_WITH("pgsql", "PostgreSQL support", "no"); if (PHP_PGSQL != "no") { if (CHECK_LIB("libpq.lib", "pgsql", PHP_PGSQL) && CHECK_HEADER_ADD_INCLUDE("libpq-fe.h", "CFLAGS_PGSQL", PHP_PGSQL + "\\include;" + PHP_PHP_BUILD + "\\include\\pgsql;" + PHP_PHP_BUILD + "\\include\\libpq;" + PHP_PGSQL)) { - EXTENSION("pgsql", "pgsql.c"); + EXTENSION("pgsql", "pgsql.c", PHP_PGSQL_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); AC_DEFINE('HAVE_PGSQL', 1, 'Have PostgreSQL library'); ADD_FLAG("CFLAGS_PGSQL", "/D HAVE_PG_CONFIG_H /D PGSQL_EXPORTS /D HAVE_PQSETNONBLOCKING /D HAVE_PQCMDTUPLES /D HAVE_PQCLIENTENCODING /D HAVE_PQESCAPE /D HAVE_PQPARAMETERSTATUS /D HAVE_PGTRANSACTIONSTATUS /D HAVE_PQEXECPARAMS /D HAVE_PQPREPARE /D HAVE_PQEXECPREPARED /D HAVE_PQRESULTERRORFIELD /D HAVE_PQSENDQUERYPARAMS /D HAVE_PQSENDPREPARE /D HAVE_PQSENDQUERYPREPARED /D HAVE_PQPUTCOPYDATA /D HAVE_PQPUTCOPYEND /D HAVE_PQGETCOPYDATA /D HAVE_PQSETERRORVERBOSITY /D HAVE_PQUNESCAPEBYTEA /D HAVE_PQFTABLE /D HAVE_PQESCAPE_CONN /D HAVE_PQESCAPE_BYTEA_CONN /D HAVE_PQFREEMEM /D HAVE_PGSQL_WITH_MULTIBYTE_SUPPORT /D HAVE_PQPROTOCOLVERSION /D HAVE_PG_LO_CREATE /D HAVE_PG_LO_IMPORT_WITH_OID /D HAVE_PG_LO_TRUNCATE /D HAVE_PG_LO64 /D HAVE_PQESCAPELITERAL /D HAVE_PQOIDVALUE"); } else { diff --git a/ext/pgsql/pgsql.c b/ext/pgsql/pgsql.c index 207764b..3645e0a 100644 --- a/ext/pgsql/pgsql.c +++ b/ext/pgsql/pgsql.c @@ -771,6 +771,9 @@ zend_module_entry pgsql_module_entry = { /* }}} */ #ifdef COMPILE_DL_PGSQL +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(pgsql) #endif @@ -1090,6 +1093,9 @@ PHP_INI_END() */ static PHP_GINIT_FUNCTION(pgsql) { +#if defined(COMPILE_DL_PGSQL) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif memset(pgsql_globals, 0, sizeof(zend_pgsql_globals)); /* Initilize notice message hash at MINIT only */ zend_hash_init_ex(&pgsql_globals->notices, 0, NULL, PHP_PGSQL_NOTICE_PTR_DTOR, 1, 0); diff --git a/ext/pgsql/php_pgsql.h b/ext/pgsql/php_pgsql.h index 661c02f..18f1bbe 100644 --- a/ext/pgsql/php_pgsql.h +++ b/ext/pgsql/php_pgsql.h @@ -322,7 +322,10 @@ ZEND_END_MODULE_GLOBALS(pgsql) ZEND_EXTERN_MODULE_GLOBALS(pgsql) #ifdef ZTS -# define PGG(v) TSRMG(pgsql_globals_id, zend_pgsql_globals *, v) +# define PGG(v) ZEND_TSRMG(pgsql_globals_id, zend_pgsql_globals *, v) +# ifdef COMPILE_DL_PGSQL +ZEND_TSRMLS_CACHE_EXTERN; +# endif #else # define PGG(v) (pgsql_globals.v) #endif diff --git a/ext/phar/config.m4 b/ext/phar/config.m4 index 614d672..1ba7ecd 100644 --- a/ext/phar/config.m4 +++ b/ext/phar/config.m4 @@ -5,7 +5,7 @@ PHP_ARG_ENABLE(phar, for phar archive support, [ --disable-phar Disable phar support], yes) if test "$PHP_PHAR" != "no"; then - PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar..c phar_object.c phar_path_check.c, $ext_shared) + PHP_NEW_EXTENSION(phar, util.c tar.c zip.c stream.c func_interceptors.c dirstream.c phar.c phar_object.c phar_path_check.c, $ext_shared, -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1) AC_MSG_CHECKING([for phar openssl support]) if test "$PHP_HASH_SHARED" != "yes"; then if test "$PHP_HASH" != "no"; then diff --git a/ext/phar/config.w32 b/ext/phar/config.w32 index 93504f6..6dba20a 100644 --- a/ext/phar/config.w32 +++ b/ext/phar/config.w32 @@ -9,7 +9,7 @@ if (PHP_PHAR_NATIVE_SSL != "no") { } if (PHP_PHAR != "no") { - EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c"); + EXTENSION("phar", "dirstream.c func_interceptors.c phar.c phar_object.c phar_path_check.c stream.c tar.c util.c zip.c", PHP_PHAR_SHARED, "/DZEND_ENABLE_STATIC_TSRMLS_CACHE=1"); if (PHP_PHAR_SHARED || (PHP_PHAR_NATIVE_SSL_SHARED && PHP_SNAPSHOT_BUILD == "no")) { ADD_FLAG("CFLAGS_PHAR", "/D COMPILE_DL_PHAR "); } diff --git a/ext/phar/phar.c b/ext/phar/phar.c index cdc61fe..5e0ccb5 100644 --- a/ext/phar/phar.c +++ b/ext/phar/phar.c @@ -3228,6 +3228,9 @@ int phar_flush(phar_archive_data *phar, char *user_stub, zend_long len, int conv /* }}} */ #ifdef COMPILE_DL_PHAR +#ifdef ZTS +ZEND_TSRMLS_CACHE_DEFINE; +#endif ZEND_GET_MODULE(phar) #endif @@ -3335,6 +3338,9 @@ static void mime_type_dtor(zval *zv) PHP_GINIT_FUNCTION(phar) /* {{{ */ { +#if defined(COMPILE_DL_PHAR) && defined(ZTS) + ZEND_TSRMLS_CACHE_UPDATE; +#endif phar_mime_type mime; memset(phar_globals, 0, sizeof(zend_phar_globals)); diff --git a/ext/phar/phar_internal.h b/ext/phar/phar_internal.h index ed5fedd..7fe647b 100644 --- a/ext/phar/phar_internal.h +++ b/ext/phar/phar_internal.h @@ -196,8 +196,11 @@ ZEND_EXTERN_MODULE_GLOBALS(phar) #ifdef ZTS # include "TSRM.h" -# define PHAR_G(v) TSRMG(phar_globals_id, zend_phar_globals *, v) -# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)]) +# ifdef COMPILE_DL_PHAR +ZEND_TSRMLS_CACHE_EXTERN; +# endif +# define PHAR_G(v) ZEND_TSRMG(phar_globals_id, zend_phar_globals *, v) +# define PHAR_GLOBALS ((zend_phar_globals *) (*((void ***) ZEND_TSRMLS_CACHE))[TSRM_UNSHUFFLE_RSRC_ID(phar_globals_id)]) #else # define PHAR_G(v) (phar_globals.v) # define PHAR_GLOBALS (&phar_globals)

« previous php.cvs (#82375) next »