Re: [PHP-DEV] STR_REALLOC definition in 5.6+

[email protected] (Nikita Popov)
Newsgroups php.internals
Message-ID <CAF+90c_hUKbup4eegiBeWi03XLTx47PRynCcHikgtXk5k-cayw@mail.gmail.com>
On Thu, Sep 4, 2014 at 2:00 PM, Remi Collet <[email protected]> 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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.