Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:77059 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 96809 invoked from network); 4 Sep 2014 17:02:11 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 4 Sep 2014 17:02:11 -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.215.50 as permitted sender) X-PHP-List-Original-Sender: nikita.ppv@gmail.com X-Host-Fingerprint: 209.85.215.50 mail-la0-f50.google.com Received: from [209.85.215.50] ([209.85.215.50:35482] helo=mail-la0-f50.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id CD/40-29759-31B98045 for ; Thu, 04 Sep 2014 13:02:11 -0400 Received: by mail-la0-f50.google.com with SMTP id mc6so12219469lab.37 for ; Thu, 04 Sep 2014 10:02:08 -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 :cc:content-type; bh=Q8SWDgtJHEDofhCJTgeeEOgEk37/N3MzRf3KEvzryxU=; b=SRVC52NsKKUlhVlv3RvbsZl4EH1cncXv4ElOEqf1fQVqtzVjAk5JnVCD1St+INmIKN CHjHd5VEB8qmVt/MZ5MBVjCqhKGzYJZo1tqaWtLsJl/ECTjW5vqc0yHM6jTBtymXLJaW ZlE5MIm3k20ccvkiTfRhrbr3Y6YAchpTAv/KuL2lNKwgNOoxHz6rWUSZ6shAnAjoOdTB Cx4iu+x7NgL2QqZpi9sdYA5v/lxQYoAJZ4wD3vrPTja/jtKfoKG7pHOgUnDG+wAnpyAn wcfO9gwCP1wt533z0mftuPV4V8vHe5m1KyLgSc4vEGemT+vJSPtMAE8MjVAmyu1ZCAFr GovA== MIME-Version: 1.0 X-Received: by 10.112.44.129 with SMTP id e1mr5734972lbm.78.1409850128091; Thu, 04 Sep 2014 10:02:08 -0700 (PDT) Received: by 10.25.154.209 with HTTP; Thu, 4 Sep 2014 10:02:08 -0700 (PDT) In-Reply-To: <5408545C.6040909@FamilleCollet.com> References: <5408545C.6040909@FamilleCollet.com> Date: Thu, 4 Sep 2014 19:02:08 +0200 Message-ID: To: Remi Collet Cc: PHP Internals Content-Type: multipart/alternative; boundary=001a11347f46124d6505024050c5 Subject: Re: [PHP-DEV] STR_REALLOC definition in 5.6+ From: nikita.ppv@gmail.com (Nikita Popov) --001a11347f46124d6505024050c5 Content-Type: text/plain; charset=UTF-8 On Thu, Sep 4, 2014 at 2:00 PM, Remi Collet wrote: > For now: > > #define STR_REALLOC(ptr, size) \ > ptr = (char *) erealloc(ptr, size); > > > Dealing with https://github.com/phalcon/cphalcon/pull/2772 > > I switch from realloc to str_realloc. > But this is not portable (str_realloc is 5.6+ only) > > STR_REALLOC should be better, as portable, 5.0+ > > But should be defined as str_erealloc > > What do you think ? > > > Probably too late, as if we fix this definition, it will portable in all > versions > 5.0 except 5.6.0 :( > Given that interned strings have been added in PHP 5.4 and STR_REALLOC has been defined like that for all the existing 5.4 and 5.5 releases, you'd have to do a version check in any case. So I don't see much point in this... Nikita --001a11347f46124d6505024050c5--