SS>> If you move the additional check (newlen <
SS>> SMART_STR_START_SIZE) and preallocation into the if (!(d)->c)
SS>> branch, the changes won't affect the common code path.
IMO, the common code path is that of SMART_STR_START_SIZE, since as I
said 90% of strings never reach beyond initial alloc. But I see your
point, you are right, the START_SIZE one should be into if (!(d)->c)
branch.
SS>>
SS>> > @@ -47,7 +51,11 @@
SS>> > if (!(d)->c) (d)->len = (d)->a = 0;
\
SS>> > newlen = (d)->len + (n);
\
SS>> > if (newlen >= (d)->a) {
\
SS>> > + if((d)->a == 0 && newlen < SMART_STR_START_SIZE) {
\
SS>> > + (d)->a = SMART_STR_START_SIZE;
\
SS>> > + } else {
\
SS>> > (d)->a = newlen + SMART_STR_PREALLOC;
\
SS>> > + }
\
SS>> > (d)->c = SMART_STR_REALLOC((d)->c, (d)->a + 1, (what));
\
SS>> > }
\
SS>> > } while (0)
SS>>
SS>> - Sascha
SS>>
SS>>
--
Stanislav Malyshev, Zend Products Engineer
[EMAIL PROTECTED] http://www.zend.com/ +972-3-6139665 ext.109
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php