Re: Streams constify API change in master leads to compilation warning for extensions
| From: | Johannes Schlüter | Date: | Thu, 03 Oct 2013 16:17:31 +0000 |
| Subject: | Re: Streams constify API change in master leads to compilation warning for extensions | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-69478@lists.php.net to get a copy of this message | ||
On Wed, 2013-10-02 at 23:01 -0400, William Bartlett wrote:
> My understanding is that the const triggers some optimizations because the
> compiler better understands how the variables are used.
There's not really much win. In most cases the generated code is exactly
the same.*) Such changes are nice to spot bugs as the compiler has more
knowledge of the intention and to make C++ compilers happy when using
these APIs as C++ is stricter on const.
johannes
*) there are few cases where this helps with inlining or passing params
via register, but here we mostly deal with exported APIs which have to
follow the platforms ABI rules.