]> granicus.if.org Git - php/commit
Always pass return_value_ptr to internal functions
authorNikita Popov <nikic@php.net>
Mon, 26 Aug 2013 17:06:36 +0000 (19:06 +0200)
committerNikita Popov <nikic@php.net>
Sat, 31 Aug 2013 11:16:41 +0000 (13:16 +0200)
commit08567145763f25aae3882f682d41d1b50cd9e666
tree0458355affcbbbf8c936dc01f1792182c7b6ad6a
parentd7ffca590b4ee188a5dcdbafb036e6541f3c79be
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.
UPGRADING.INTERNALS
Zend/zend_API.h
Zend/zend_execute.c
Zend/zend_execute_API.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h