Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:85446 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 23128 invoked from network); 24 Mar 2015 12:08:16 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 24 Mar 2015 12:08:16 -0000 Authentication-Results: pb1.pair.com smtp.mail=dmitry@zend.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=dmitry@zend.com; sender-id=pass Received-SPF: pass (pb1.pair.com: domain zend.com designates 209.85.160.178 as permitted sender) X-PHP-List-Original-Sender: dmitry@zend.com X-Host-Fingerprint: 209.85.160.178 mail-yk0-f178.google.com Received: from [209.85.160.178] ([209.85.160.178:36493] helo=mail-yk0-f178.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id D3/91-12194-FA351155 for ; Tue, 24 Mar 2015 07:08:15 -0500 Received: by ykcn8 with SMTP id n8so87091963ykc.3 for ; Tue, 24 Mar 2015 05:08:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=k0uGCbO85rcOU+/aAMczqMgdX/SXjhrLf5olQYbSjuI=; b=HRFoRKs8bK3t8Q9N4AyxOMWKbf7JsdIAYGP16rYCIPJFd0GrdRbJaRmh5t8T2qsFl+ MPiZwbGpWg27zn9o4gjQbmsgI/rOWXvE7KnSilEpik2T9dvAInP9S2A5ONqPv+eMoPwB S7Q6mWcAy9XLNeLPjtzjK5rQ1W9S9I2SsrT+g9rXhG8BsTNezKDrNCwfBxl38KuV1owI Dlrw4ahnL3wKE7E0Nvrqmp4JH3yToDcPYpNbt++xZCfRuKmkXLZMdC+GxXguwaF/CnsA y3C/It5VOy5zVzPQIgntjULdievPAZfpgzi4VuVgBJIdooIQBK+QEDTTVxx85J4tjcVa tFfQ== X-Gm-Message-State: ALoCoQm5ZmTesYIW4t5Kc5DyMPdivwuEShdG1n1LGZAqqvDnqTTDAstOQvfnlrnBp0ulBuyco9aTx9Rt9LVkSp/Wb5ro/TU3MMYBEpnu0vgAzWz1xZ63ROClj0ZY2F7ZCNVfV/jVrgsVz5N5Z2I9EUyR0Z1G9J/gTw== MIME-Version: 1.0 X-Received: by 10.53.9.66 with SMTP id dq2mr2890996vdd.65.1427198892532; Tue, 24 Mar 2015 05:08:12 -0700 (PDT) Received: by 10.52.248.36 with HTTP; Tue, 24 Mar 2015 05:08:12 -0700 (PDT) In-Reply-To: References: Date: Tue, 24 Mar 2015 15:08:12 +0300 Message-ID: To: Nikita Popov Cc: Xinchen Hui , Joe Watkins , PHP Internals Content-Type: multipart/alternative; boundary=001a1133f77c0380d6051207a3b4 Subject: Re: Use "ropes" for string concatenation From: dmitry@zend.com (Dmitry Stogov) --001a1133f77c0380d6051207a3b4 Content-Type: text/plain; charset=UTF-8 On Tue, Mar 24, 2015 at 2:51 PM, Nikita Popov wrote: > On Tue, Mar 24, 2015 at 10:28 AM, Dmitry Stogov wrote: > >> I thought about something like this :) >> In my opinion UString is really not a proper way to implement Unicoide, >> but I agree not break anything in current stage. >> Anyway, please review the first PR (in my opinion it is safe to commit), >> but you may find some other issues. >> >> Thanks. Dmitry. >> > > First PR looks okay to me. One question: Why the separate INIT and ADD > opcodes? They seem pretty much the same, just one using a hardcoded 0 > instead of ex_val. > Oh. It's historical, at first we allocated rope on heap. I'll check if INIT_ROPE is still necessary. Most probably we still need it, to know the size of rope vector. > Regarding exception-safety - is the problem that doing an EG(exception) > check and releasing the rope is too expensive? > No. It's a common problem. Because exception may be thrown in some other opcode and we don't clean IS_VAR/IS_TMP_VAR zvals. For example the following script leaks independently from the patch Thanks. Dmitry. > > Nikita > --001a1133f77c0380d6051207a3b4--