diff options
author | Dmitry Stogov <dmitry@zend.com> | 2015-03-20 02:02:42 +0300 |
---|---|---|
committer | Dmitry Stogov <dmitry@zend.com> | 2015-03-20 02:02:42 +0300 |
commit | d146d15003442a2e5234dd2fab1605094dc21630 (patch) | |
tree | 3a20cd8866a8544ed8bfd04b8c71f7041b4ca91e /ext/reflection/php_reflection.c | |
parent | 184793b5c1e7a9df67e542893b69bace5cd7a67c (diff) | |
download | php-git-d146d15003442a2e5234dd2fab1605094dc21630.tar.gz |
Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate()
Diffstat (limited to 'ext/reflection/php_reflection.c')
-rw-r--r-- | ext/reflection/php_reflection.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/reflection/php_reflection.c b/ext/reflection/php_reflection.c index bed3823a4e..72a88be47c 100644 --- a/ext/reflection/php_reflection.c +++ b/ext/reflection/php_reflection.c @@ -140,7 +140,7 @@ static string *string_printf(string *str, const char *format, ...) if (str->alloced < nlen) { size_t old_len = str->buf->len; str->alloced = nlen; - str->buf = zend_string_realloc(str->buf, str->alloced, 0); + str->buf = zend_string_extend(str->buf, str->alloced, 0); str->buf->len = old_len; } memcpy(str->buf->val + str->buf->len, s_tmp, len + 1); @@ -157,7 +157,7 @@ static string *string_write(string *str, char *buf, size_t len) if (str->alloced < nlen) { size_t old_len = str->buf->len; str->alloced = nlen; - str->buf = zend_string_realloc(str->buf, str->alloced, 0); + str->buf = zend_string_extend(str->buf, str->alloced, 0); str->buf->len = old_len; } memcpy(str->buf->val + str->buf->len, buf, len); |