summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/SAPI.c4
-rw-r--r--main/SAPI.h2
-rw-r--r--main/main.c9
-rw-r--r--main/output.c2
-rw-r--r--main/php.h2
-rw-r--r--main/php_globals.h2
-rw-r--r--main/php_output.h1
7 files changed, 11 insertions, 11 deletions
diff --git a/main/SAPI.c b/main/SAPI.c
index f00e3c728b..50ea8c0a16 100644
--- a/main/SAPI.c
+++ b/main/SAPI.c
@@ -52,7 +52,7 @@
#include "php_content_types.h"
#ifdef ZTS
-TSRMG_D(sapi_globals_struct, sapi_globals_id);
+SAPI_API int sapi_globals_id;
#else
sapi_globals_struct sapi_globals;
#endif
@@ -88,7 +88,7 @@ SAPI_API void sapi_startup(sapi_module_struct *sf)
sapi_module = *sf;
#ifdef ZTS
- TSRMG_ALLOCATE(sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor);
+ ts_allocate_id(&sapi_globals_id, sizeof(sapi_globals_struct), (ts_allocate_ctor) sapi_globals_ctor, (ts_allocate_dtor) sapi_globals_dtor);
# ifdef PHP_WIN32
_configthreadlocale(_ENABLE_PER_THREAD_LOCALE);
# endif
diff --git a/main/SAPI.h b/main/SAPI.h
index 4e2b4cd420..79661371d9 100644
--- a/main/SAPI.h
+++ b/main/SAPI.h
@@ -143,7 +143,7 @@ typedef struct _sapi_globals_struct {
BEGIN_EXTERN_C()
#ifdef ZTS
# define SG(v) TSRMG(sapi_globals_id, sapi_globals_struct *, v)
-TSRMG_DH(sapi_globals_struct, sapi_globals_id);
+SAPI_API extern int sapi_globals_id;
#else
# define SG(v) (sapi_globals.v)
extern SAPI_API sapi_globals_struct sapi_globals;
diff --git a/main/main.c b/main/main.c
index 2a78d4b0d2..63144de418 100644
--- a/main/main.c
+++ b/main/main.c
@@ -124,7 +124,7 @@ PHPAPI int (*php_register_internal_extensions_func)(TSRMLS_D) = php_register_int
#ifndef ZTS
php_core_globals core_globals;
#else
-TSRMG_D(php_core_globals, core_globals_id);
+PHPAPI int core_globals_id;
#endif
#ifdef PHP_WIN32
@@ -2048,6 +2048,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
zend_module_entry *module;
#ifdef ZTS
zend_executor_globals *executor_globals;
+ void ***tsrm_ls;
php_core_globals *core_globals;
#endif
@@ -2072,7 +2073,7 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#endif
#ifdef ZTS
- TSRMLS_INIT();
+ tsrm_ls = ts_resource(0);
#endif
#ifdef PHP_WIN32
@@ -2111,10 +2112,10 @@ int php_module_startup(sapi_module_struct *sf, zend_module_entry *additional_mod
#ifdef ZTS
executor_globals = ts_resource(executor_globals_id);
- TSRMG_ALLOCATE(core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
+ ts_allocate_id(&core_globals_id, sizeof(php_core_globals), (ts_allocate_ctor) core_globals_ctor, (ts_allocate_dtor) core_globals_dtor);
core_globals = ts_resource(core_globals_id);
#ifdef PHP_WIN32
- TSRMG_ALLOCATE(php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor);
+ ts_allocate_id(&php_win32_core_globals_id, sizeof(php_win32_core_globals), (ts_allocate_ctor) php_win32_core_globals_ctor, (ts_allocate_dtor) php_win32_core_globals_dtor);
#endif
#else
php_startup_ticks(TSRMLS_C);
diff --git a/main/output.c b/main/output.c
index 65c8152bc0..2f3f8d5a34 100644
--- a/main/output.c
+++ b/main/output.c
@@ -160,7 +160,7 @@ PHPAPI void php_output_shutdown(void)
PHPAPI int php_output_activate(TSRMLS_D)
{
#ifdef ZTS
- //memset((*((void ***) tsrm_ls))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)], 0, sizeof(zend_output_globals));
+ memset((*((void ***) tsrm_get_ls_cache()))[TSRM_UNSHUFFLE_RSRC_ID(output_globals_id)], 0, sizeof(zend_output_globals));
#else
memset(&output_globals, 0, sizeof(zend_output_globals));
#endif
diff --git a/main/php.h b/main/php.h
index 224a65dd82..2a683e1924 100644
--- a/main/php.h
+++ b/main/php.h
@@ -301,7 +301,7 @@ static inline ZEND_ATTRIBUTE_DEPRECATED void php_std_error_handling() {}
PHPAPI void php_verror(const char *docref, const char *params, int type, const char *format, va_list args TSRMLS_DC) PHP_ATTRIBUTE_FORMAT(printf, 4, 0);
-#ifdef PASS_TSRMLS
+#ifdef ZTS
#define PHP_ATTR_FMT_OFFSET 1
#else
#define PHP_ATTR_FMT_OFFSET 0
diff --git a/main/php_globals.h b/main/php_globals.h
index 0e088d20f0..a60efe69de 100644
--- a/main/php_globals.h
+++ b/main/php_globals.h
@@ -27,7 +27,7 @@ typedef struct _php_core_globals php_core_globals;
#ifdef ZTS
# define PG(v) TSRMG(core_globals_id, php_core_globals *, v)
-TSRMG_DH(php_core_globals, core_globals_id);
+extern PHPAPI int core_globals_id;
#else
# define PG(v) (core_globals.v)
extern ZEND_API struct _php_core_globals core_globals;
diff --git a/main/php_output.h b/main/php_output.h
index d3c3e072d0..02b2b85d13 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -153,7 +153,6 @@ ZEND_END_MODULE_GLOBALS(output)
/* there should not be a need to use OG() from outside of output.c */
#ifdef ZTS
-TSRMG_DH(php_output_globals, output_globals_id);
# define OG(v) TSRMG(output_globals_id, zend_output_globals *, v)
#else
# define OG(v) (output_globals.v)