Re: Always set return_value_ptr?
| From: | Nikita Popov | Date: | Tue, 27 Aug 2013 09:40:35 +0000 |
| Subject: | Re: Always set return_value_ptr? | ||
| References: | 1 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-68624@lists.php.net to get a copy of this message | ||
On Sat, Aug 3, 2013 at 8:16 PM, Nikita Popov <nikita.ppv@gmail.com> wrote:
> Hi internals!
>
> Is there any particular reason why we only pass return_value_ptr to
> internal functions if they have the ACC_RETURN_REFERENCE flag set?
>
> Why can't we always provide the retval ptr, even for functions that don't
> return by reference? This would allow returning zvals without having to
> copy them first (what RETVAL_ZVAL does).
>
> Motivation for this is the following SO question:
> http://stackoverflow.com/q/17844379/385378
>
Patch for this change can be found here:
https://github.com/php/php-src/pull/420
The patch also adds new macros to allow easy use of this feature called
RETVAL_ZVAL_FAST/RETURN_ZVAL_FAST (anyone got a better name?)
If no one objects I'll merge this sometime soon.
Nikita