com php-src: Improve call_user_function performance: Zend/zend_execute_API.c
| From: | Xinchen Hui | Date: | Mon, 26 May 2014 09:16:22 +0000 |
| Subject: | com php-src: Improve call_user_function performance: Zend/zend_execute_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78542@lists.php.net to get a copy of this message | ||
Commit: bd4b9837e9d839ea527e22d35cb7f7cf9d80d839
Author: Xinchen Hui <laruence@php.net> Mon, 26 May 2014 17:16:22 +0800
Parents: b66728aabbe4f2cb94b6f04a7ca2456d7a8a0b71
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=bd4b9837e9d839ea527e22d35cb7f7cf9d80d839
Log:
Improve call_user_function performance
params are all zval * now, and retval will be initialized in
zend_call_function.
maybe we can make call_user_function as a macro proxy to
call_user_function_ex later.
Changed paths:
M Zend/zend_execute_API.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 2b62f2e..0a21e06 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -626,24 +626,7 @@ ZEND_API int zval_update_constant(zval *pp, zend_bool inline_change TSRMLS_DC)
/
int call_user_function(HashTable *function_table, zval *object, zval *function_name, zval
*retval_ptr, zend_uint param_count, zval params[] TSRMLS_DC) /* {{{ */
{
- zval *params_array;
- zend_uint i;
- int ex_retval;
-
- if (param_count) {
- params_array = (zval *) emalloc(sizeof(zval) * param_count);
- for (i=0; i<param_count; i++) {
- ZVAL_COPY_VALUE(¶ms_array[i], ¶ms[i]);
- }
- } else {
- params_array = NULL;
- }
- ZVAL_UNDEF(retval_ptr);
- ex_retval = call_user_function_ex(function_table, object, function_name, retval_ptr, param_count,
params_array, 1, NULL TSRMLS_CC);
- if (params_array) {
- efree(params_array);
- }
- return ex_retval;
+ return call_user_function_ex(function_table, object, function_name, retval_ptr, param_count,
params, 1, NULL TSRMLS_CC);
}
/* }}} */