com php-src: Eliminate the TSRMLS_FETCH() calls in the ticks functions and hook: Zend/zend.c Zend/ zend.h Zend/zend_vm_def.h Zend/zend_vm_execute .h
ext/pcntl/pcntl.c ext/standard/basic_functions.c main/php_ticks.c main/php_ticks.h
| From: | Kalle Sommer Nielsen | Date: | Wed, 18 Dec 2013 08:32:26 +0000 |
| Subject: | com php-src: Eliminate the TSRMLS_FETCH() calls in the ticks functions and hook: Zend/zend.c Zend/ zend.h Zend/zend_vm_def.h Zend/zend_vm_execute .h ext/pcntl/pcntl.c ext/standard/basic_functions.c main/php_ticks.c main/php_ticks.h |
||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-74495@lists.php.net to get a copy of this message | ||
Commit: aed4b086acaa50318b3e91146a35a9af6f46e11d
Author: Kalle Sommer Nielsen <kalle@php.net> Wed, 18 Dec 2013 09:32:26 +0100
Parents: c83598119be083b572e92af292e9e9faa98d8d85
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=aed4b086acaa50318b3e91146a35a9af6f46e11d
Log:
Eliminate the TSRMLS_FETCH() calls in the ticks functions and hook
Changed paths:
M Zend/zend.c
M Zend/zend.h
M Zend/zend_vm_def.h
M Zend/zend_vm_execute.h
M ext/pcntl/pcntl.c
M ext/standard/basic_functions.c
M main/php_ticks.c
M main/php_ticks.h
Diff:
diff --git a/Zend/zend.c b/Zend/zend.c
index 33161f7..ad45028 100644
--- a/Zend/zend.c
+++ b/Zend/zend.c
@@ -56,7 +56,7 @@ ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC)
ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle
TSRMLS_DC);
ZEND_API void (*zend_block_interruptions)(void);
ZEND_API void (*zend_unblock_interruptions)(void);
-ZEND_API void (*zend_ticks_function)(int ticks);
+ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint error_lineno, const
char *format, va_list args);
int (*zend_vspprintf)(char **pbuf, size_t max_len, const char *format, va_list ap);
ZEND_API char *(*zend_getenv)(char *name, size_t name_len TSRMLS_DC);
diff --git a/Zend/zend.h b/Zend/zend.h
index 30d05d2..f60ef68 100644
--- a/Zend/zend.h
+++ b/Zend/zend.h
@@ -550,7 +550,7 @@ typedef struct _zend_utility_functions {
void (*block_interruptions)(void);
void (*unblock_interruptions)(void);
int (*get_configuration_directive)(const char *name, uint name_length, zval *contents);
- void (*ticks_function)(int ticks);
+ void (*ticks_function)(int ticks TSRMLS_DC);
void (*on_timeout)(int seconds TSRMLS_DC);
int (*stream_open_function)(const char *filename, zend_file_handle *handle TSRMLS_DC);
int (*vspprintf_function)(char **pbuf, size_t max_len, const char *format, va_list ap);
@@ -698,7 +698,7 @@ extern ZEND_API zend_write_func_t zend_write;
extern ZEND_API FILE *(*zend_fopen)(const char *filename, char **opened_path TSRMLS_DC);
extern ZEND_API void (*zend_block_interruptions)(void);
extern ZEND_API void (*zend_unblock_interruptions)(void);
-extern ZEND_API void (*zend_ticks_function)(int ticks);
+extern ZEND_API void (*zend_ticks_function)(int ticks TSRMLS_DC);
extern ZEND_API void (*zend_error_cb)(int type, const char *error_filename, const uint
error_lineno, const char *format, va_list args) ZEND_ATTRIBUTE_PTR_FORMAT(printf, 4, 0);
extern ZEND_API void (*zend_on_timeout)(int seconds TSRMLS_DC);
extern ZEND_API int (*zend_stream_open_function)(const char *filename, zend_file_handle *handle
TSRMLS_DC);
diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h
index 97db4bb..58a7b33 100644
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@ -4911,7 +4911,7 @@ ZEND_VM_HANDLER(105, ZEND_TICKS, ANY, ANY)
if (++EG(ticks_count)>=opline->extended_value) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value);
+ zend_ticks_function(opline->extended_value TSRMLS_CC);
}
}
CHECK_EXCEPTION();
diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h
index d76e627..24d6aad 100644
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@ -954,7 +954,7 @@ static int ZEND_FASTCALL ZEND_TICKS_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
if (++EG(ticks_count)>=opline->extended_value) {
EG(ticks_count)=0;
if (zend_ticks_function) {
- zend_ticks_function(opline->extended_value);
+ zend_ticks_function(opline->extended_value TSRMLS_CC);
}
}
CHECK_EXCEPTION();
diff --git a/ext/pcntl/pcntl.c b/ext/pcntl/pcntl.c
index b66f472..8dfb254 100644
--- a/ext/pcntl/pcntl.c
+++ b/ext/pcntl/pcntl.c
@@ -499,7 +499,7 @@ PHP_MINIT_FUNCTION(pcntl)
{
php_register_signal_constants(INIT_FUNC_ARGS_PASSTHRU);
php_pcntl_register_errno_constants(INIT_FUNC_ARGS_PASSTHRU);
- php_add_tick_function(pcntl_signal_dispatch);
+ php_add_tick_function(pcntl_signal_dispatch TSRMLS_CC);
return SUCCESS;
}
diff --git a/ext/standard/basic_functions.c b/ext/standard/basic_functions.c
index f55925f..33f1364 100644
--- a/ext/standard/basic_functions.c
+++ b/ext/standard/basic_functions.c
@@ -5751,7 +5751,7 @@ PHP_FUNCTION(register_tick_function)
zend_llist_init(BG(user_tick_functions),
sizeof(user_tick_function_entry),
(llist_dtor_func_t) user_tick_function_dtor, 0);
- php_add_tick_function(run_user_tick_functions);
+ php_add_tick_function(run_user_tick_functions TSRMLS_CC);
}
for (i = 0; i < tick_fe.arg_count; i++) {
diff --git a/main/php_ticks.c b/main/php_ticks.c
index 17ffb9c..c65fc32 100644
--- a/main/php_ticks.c
+++ b/main/php_ticks.c
@@ -46,17 +46,13 @@ static int php_compare_tick_functions(void *elem1, void *elem2)
return (func1 == func2);
}
-PHPAPI void php_add_tick_function(void (*func)(int))
+PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_add_element(&PG(tick_functions), (void *)&func);
}
-PHPAPI void php_remove_tick_function(void (*func)(int))
+PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_del_element(&PG(tick_functions), (void *)func,
(int(*)(void*, void*))php_compare_tick_functions);
}
@@ -69,10 +65,8 @@ static void php_tick_iterator(void *data, void *arg TSRMLS_DC)
func(*((int *)arg));
}
-void php_run_ticks(int count)
+void php_run_ticks(int count TSRMLS_DC)
{
- TSRMLS_FETCH();
-
zend_llist_apply_with_argument(&PG(tick_functions), (llist_apply_with_arg_func_t)
php_tick_iterator, &count TSRMLS_CC);
}
diff --git a/main/php_ticks.h b/main/php_ticks.h
index cc966fa..9f50af0 100644
--- a/main/php_ticks.h
+++ b/main/php_ticks.h
@@ -24,11 +24,11 @@
int php_startup_ticks(TSRMLS_D);
void php_deactivate_ticks(TSRMLS_D);
void php_shutdown_ticks(TSRMLS_D);
-void php_run_ticks(int count);
+void php_run_ticks(int count TSRMLS_DC);
BEGIN_EXTERN_C()
-PHPAPI void php_add_tick_function(void (*func)(int));
-PHPAPI void php_remove_tick_function(void (*func)(int));
+PHPAPI void php_add_tick_function(void (*func)(int) TSRMLS_DC);
+PHPAPI void php_remove_tick_function(void (*func)(int) TSRMLS_DC);
END_EXTERN_C()
#endif