diff options
| author | Nikita Popov <nikic@php.net> | 2013-08-26 19:06:36 +0200 |
|---|---|---|
| committer | Nikita Popov <nikic@php.net> | 2013-08-31 13:16:41 +0200 |
| commit | 08567145763f25aae3882f682d41d1b50cd9e666 (patch) | |
| tree | 0458355affcbbbf8c936dc01f1792182c7b6ad6a /Zend/zend_execute_API.c | |
| parent | d7ffca590b4ee188a5dcdbafb036e6541f3c79be (diff) | |
| download | php-git-08567145763f25aae3882f682d41d1b50cd9e666.tar.gz | |
Always pass return_value_ptr to internal functions
Previous some places passed return_value_ptr only if the function
returned by reference. Now return_value_ptr is always set, even
for functions returning by-value.
This allows you to return zvals without copying their contents. For
this purpose two new macros RETVAL_ZVAL_FAST and RETURN_ZVAL_FAST
are added:
RETVAL_ZVAL_FAST(zv); /* Analog to RETVAL_ZVAL(zv, 1, 0) */
RETURN_ZVAL_FAST(zv); /* Analog to RETURN_ZVAL(zv, 1, 0) */
These macros behave similarly to the non-FAST versions with
copy=1 and dtor=0, with the difference that the FAST versions
will try return the zval without copying by utilizing return_value_ptr.
Diffstat (limited to 'Zend/zend_execute_API.c')
| -rw-r--r-- | Zend/zend_execute_API.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c index 83c2217984..0b29086a0d 100644 --- a/Zend/zend_execute_API.c +++ b/Zend/zend_execute_API.c @@ -952,9 +952,9 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS if (EX(function_state).function->common.scope) { EG(scope) = EX(function_state).function->common.scope; } - if(EXPECTED(zend_execute_internal == NULL)) { + if (EXPECTED(zend_execute_internal == NULL)) { /* saves one function call if zend_execute_internal is not used */ - ((zend_internal_function *) EX(function_state).function)->handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); + EX(function_state).function->internal_function.handler(fci->param_count, *fci->retval_ptr_ptr, fci->retval_ptr_ptr, fci->object_ptr, 1 TSRMLS_CC); } else { zend_execute_internal(&execute_data, fci, 1 TSRMLS_CC); } |
