summaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/main.c13
-rw-r--r--main/network.c2
-rw-r--r--main/output.c5
-rw-r--r--main/php_ini.c1
-rw-r--r--main/php_output.h5
-rw-r--r--main/snprintf.c1
-rw-r--r--main/spprintf.c1
-rw-r--r--main/streams/cast.c14
8 files changed, 1 insertions, 41 deletions
diff --git a/main/main.c b/main/main.c
index d7d7c44f80..3681f28545 100644
--- a/main/main.c
+++ b/main/main.c
@@ -376,7 +376,6 @@ static PHP_INI_DISP(display_errors_mode)
{
int mode, tmp_value_length, cgi_or_cli;
char *tmp_value;
- TSRMLS_FETCH();
if (type == ZEND_INI_DISPLAY_ORIG && ini_entry->modified) {
tmp_value = (ini_entry->orig_value ? ini_entry->orig_value->val : NULL );
@@ -723,7 +722,6 @@ PHPAPI size_t php_printf(const char *format, ...)
size_t ret;
char *buffer;
size_t size;
- TSRMLS_FETCH();
va_start(args, format);
size = vspprintf(&buffer, 0, format, args);
@@ -999,7 +997,6 @@ static void php_error_cb(int type, const char *error_filename, const uint error_
{
char *buffer;
int buffer_len, display;
- TSRMLS_FETCH();
buffer_len = vspprintf(&buffer, PG(log_errors_max_len), format, args);
@@ -1716,8 +1713,6 @@ int php_request_startup_for_hook(TSRMLS_D)
*/
void php_request_shutdown_for_exec(void *dummy)
{
- TSRMLS_FETCH();
-
/* used to close fd's in the 3..255 range here, but it's problematic
*/
shutdown_memory_manager(1, 1 TSRMLS_CC);
@@ -1729,8 +1724,6 @@ void php_request_shutdown_for_exec(void *dummy)
*/
void php_request_shutdown_for_hook(void *dummy)
{
- TSRMLS_FETCH();
-
if (PG(modules_activated)) zend_try {
php_call_shutdown_functions(TSRMLS_C);
} zend_end_try();
@@ -1782,7 +1775,6 @@ void php_request_shutdown_for_hook(void *dummy)
void php_request_shutdown(void *dummy)
{
zend_bool report_memleaks;
- TSRMLS_FETCH();
report_memleaks = PG(report_memleaks);
@@ -1918,7 +1910,6 @@ PHPAPI void php_com_initialize(TSRMLS_D)
*/
static size_t php_output_wrapper(const char *str, size_t str_length)
{
- TSRMLS_FETCH();
return php_output_write(str, str_length TSRMLS_CC);
}
/* }}} */
@@ -2017,7 +2008,6 @@ void dummy_invalid_parameter_handler(
int len;
if (!called) {
- TSRMLS_FETCH();
if(PG(windows_show_crt_warning)) {
called = 1;
if (function) {
@@ -2403,7 +2393,6 @@ void php_module_shutdown_for_exec(void)
*/
int php_module_shutdown_wrapper(sapi_module_struct *sapi_globals)
{
- TSRMLS_FETCH();
php_module_shutdown(TSRMLS_C);
return SUCCESS;
}
@@ -2617,8 +2606,6 @@ PHPAPI int php_execute_simple_script(zend_file_handle *primary_file, zval *ret T
*/
PHPAPI void php_handle_aborted_connection(void)
{
- TSRMLS_FETCH();
-
PG(connection_status) = PHP_CONNECTION_ABORTED;
php_output_set_status(PHP_OUTPUT_DISABLED TSRMLS_CC);
diff --git a/main/network.c b/main/network.c
index bb21f0ffe4..34a4d04c81 100644
--- a/main/network.c
+++ b/main/network.c
@@ -1156,8 +1156,6 @@ PHPAPI int php_set_sock_blocking(int socketd, int block TSRMLS_DC)
PHPAPI void _php_emit_fd_setsize_warning(int max_fd)
{
- TSRMLS_FETCH();
-
#ifdef PHP_WIN32
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"PHP needs to be recompiled with a larger value of FD_SETSIZE.\n"
diff --git a/main/output.c b/main/output.c
index f44ae178b4..18708789ac 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
@@ -798,7 +798,6 @@ static inline php_output_context *php_output_context_init(php_output_context *co
}
memset(context, 0, sizeof(php_output_context));
- TSRMLS_SET_CTX(context->tsrm_ls);
context->op = op;
return context;
@@ -929,7 +928,6 @@ static inline php_output_handler_status_t php_output_handler_op(php_output_handl
{
php_output_handler_status_t status;
int original_op = context->op;
- PHP_OUTPUT_TSRMLS(context);
#if PHP_OUTPUT_DEBUG
fprintf(stderr, ">>> op(%d, "
@@ -1268,7 +1266,6 @@ static inline int php_output_stack_pop(int flags TSRMLS_DC)
static int php_output_handler_compat_func(void **handler_context, php_output_context *output_context)
{
php_output_handler_func_t func = *(php_output_handler_func_t *) handler_context;
- PHP_OUTPUT_TSRMLS(output_context);
if (func) {
char *out_str = NULL;
diff --git a/main/php_ini.c b/main/php_ini.c
index c90dc9f29f..d90ee9dedb 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -170,7 +170,6 @@ static int php_ini_available(zval *el, void *arg TSRMLS_DC)
PHPAPI void display_ini_entries(zend_module_entry *module)
{
int module_number, module_number_available;
- TSRMLS_FETCH();
if (module) {
module_number = module->module_number;
diff --git a/main/php_output.h b/main/php_output.h
index 02b2b85d13..bcce8720e1 100644
--- a/main/php_output.h
+++ b/main/php_output.h
@@ -102,13 +102,8 @@ typedef struct _php_output_context {
int op;
php_output_buffer in;
php_output_buffer out;
-#ifdef ZTS
- void ***tsrm_ls;
-#endif
} php_output_context;
-#define PHP_OUTPUT_TSRMLS(ctx) TSRMLS_FETCH_FROM_CTX((ctx)->tsrm_ls)
-
/* old-style, stateless callback */
typedef void (*php_output_handler_func_t)(char *output, uint output_len, char **handled_output, uint *handled_output_len, int mode TSRMLS_DC);
/* new-style, opaque context callback */
diff --git a/main/snprintf.c b/main/snprintf.c
index 062ccc4eee..d323391808 100644
--- a/main/snprintf.c
+++ b/main/snprintf.c
@@ -787,7 +787,6 @@ static int format_converter(register buffy * odp, const char *fmt, va_list ap) /
*/
switch (*fmt) {
case 'Z': {
- TSRMLS_FETCH();
zvp = (zval*) va_arg(ap, zval*);
free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC);
if (free_zcopy) {
diff --git a/main/spprintf.c b/main/spprintf.c
index cf730dd964..903c901abe 100644
--- a/main/spprintf.c
+++ b/main/spprintf.c
@@ -401,7 +401,6 @@ static void xbuf_format_converter(void *xbuf, zend_bool is_char, const char *fmt
*/
switch (*fmt) {
case 'Z': {
- TSRMLS_FETCH();
zvp = (zval*) va_arg(ap, zval*);
free_zcopy = zend_make_printable_zval(zvp, &zcopy TSRMLS_CC);
if (free_zcopy) {
diff --git a/main/streams/cast.c b/main/streams/cast.c
index 3291a9ca8f..dcb036aa4b 100644
--- a/main/streams/cast.c
+++ b/main/streams/cast.c
@@ -63,7 +63,6 @@ FILE *fopencookie(void *cookie, const char *mode, COOKIE_IO_FUNCTIONS_T *funcs)
static int stream_cookie_reader(void *cookie, char *buffer, int size)
{
int ret;
- TSRMLS_FETCH();
ret = php_stream_read((php_stream*)cookie, buffer, size);
return ret;
@@ -71,22 +70,17 @@ static int stream_cookie_reader(void *cookie, char *buffer, int size)
static int stream_cookie_writer(void *cookie, const char *buffer, int size)
{
- TSRMLS_FETCH();
-
return php_stream_write((php_stream *)cookie, (char *)buffer, size);
}
static PHP_FPOS_T stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
{
- TSRMLS_FETCH();
-
return (PHP_FPOS_T)php_stream_seek((php_stream *)cookie, position, whence);
}
static int stream_cookie_closer(void *cookie)
{
php_stream *stream = (php_stream*)cookie;
- TSRMLS_FETCH();
/* prevent recursion */
stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;
@@ -96,7 +90,6 @@ static int stream_cookie_closer(void *cookie)
static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
{
ssize_t ret;
- TSRMLS_FETCH();
ret = php_stream_read(((php_stream *)cookie), buffer, size);
return ret;
@@ -104,16 +97,12 @@ static ssize_t stream_cookie_reader(void *cookie, char *buffer, size_t size)
static ssize_t stream_cookie_writer(void *cookie, const char *buffer, size_t size)
{
- TSRMLS_FETCH();
-
return php_stream_write(((php_stream *)cookie), (char *)buffer, size);
}
# ifdef COOKIE_SEEKER_USES_OFF64_T
static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence)
{
- TSRMLS_FETCH();
-
*position = php_stream_seek((php_stream *)cookie, (zend_off_t)*position, whence);
if (*position == -1) {
@@ -124,8 +113,6 @@ static int stream_cookie_seeker(void *cookie, __off64_t *position, int whence)
# else
static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
{
- TSRMLS_FETCH();
-
return php_stream_seek((php_stream *)cookie, position, whence);
}
# endif
@@ -133,7 +120,6 @@ static int stream_cookie_seeker(void *cookie, zend_off_t position, int whence)
static int stream_cookie_closer(void *cookie)
{
php_stream *stream = (php_stream*)cookie;
- TSRMLS_FETCH();
/* prevent recursion */
stream->fclose_stdiocast = PHP_STREAM_FCLOSE_NONE;