Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:68624 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 50800 invoked from network); 27 Aug 2013 09:40:40 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Aug 2013 09:40:40 -0000 Authentication-Results: pb1.pair.com smtp.mail=nikita.ppv@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=nikita.ppv@gmail.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain gmail.com designates 209.85.214.181 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.214.181 mail-ob0-f181.google.com Received: from [209.85.214.181] ([209.85.214.181:36320] helo=mail-ob0-f181.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id AC/C6-21091-6147C125 for ; Tue, 27 Aug 2013 05:40:38 -0400 Received: by mail-ob0-f181.google.com with SMTP id dn14so4397564obc.40 for ; Tue, 27 Aug 2013 02:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=XtqiHxFFoFFFiTXqCfNyyv6yf5CvGfOwMcEeQrEcVrc=; b=i9QTQh8ILT5S1EwyIjGE+1Ti8d4u3nkgb/C3Xo8h9uUG2y8XtnsHp5vts7jJ1cq6cM elREy00bRYBaheds74zAvGlyDiVUHttJ4lOVKyLQPsLNodzz52snx5yRCyUaUVKjFN66 OSxuuUZmq/YPn/fVR3yFqgZ4XSa5YRQYR7MMJDIs6TIlr0iQgeqTwDTYv1MNrGzmK0ti LWA4erMxt/svFC7krnASuO9rD8BmiCnV4Pm/XiMP16GUGUkW7vfHGrVGq80DntXXWPgN ecwPZXl6jP/+3X9oawQR1ZuYNuk7wZcKQE12B7oumt/yq1ro6M9QBSpcdi4SCjOaGvA2 8wLA== MIME-Version: 1.0 X-Received: by 10.182.214.98 with SMTP id nz2mr1129604obc.37.1377596435402; Tue, 27 Aug 2013 02:40:35 -0700 (PDT) Received: by 10.182.98.8 with HTTP; Tue, 27 Aug 2013 02:40:35 -0700 (PDT) In-Reply-To: References: Date: Tue, 27 Aug 2013 11:40:35 +0200 Message-ID: To: PHP internals Content-Type: multipart/alternative; boundary=e89a8ff1cefe2d154704e4eaaaf2 Subject: Re: Always set return_value_ptr? From: nikita.ppv@gmail.com (Nikita Popov) --e89a8ff1cefe2d154704e4eaaaf2 Content-Type: text/plain; charset=ISO-8859-1 On Sat, Aug 3, 2013 at 8:16 PM, Nikita Popov 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 --e89a8ff1cefe2d154704e4eaaaf2--