Hi,

On Thu, Mar 25, 2010 at 8:41 AM, Stanislav Malyshev <s...@zend.com> wrote:
> Hi!
>
>> Wouldn't it suffice to add a field for the hash value and a flag that
>> indicates its validity to zval instead of appending zend_literal
>> everywhere?
>
> Enlarging zval would be costly (the engine uses tons of zvals) and may also
> be more complicated to track (all zval operations now would also have to
> take care to set the flag right - what if we forget in some extension to set
> it right?). I think it's better not to mess with zval.

If all the constants were "intern"ed, then we should not need
zend_literal in the first place because we can store the hash values
separately in an array whose indices correspond to those of the
interned string vector.  Plus, I think the hash value can be stored in
the following extra bytes of the string buffer pointed by str.val.

Moriyoshi

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to