summaryrefslogtreecommitdiff
path: root/ext/pcre/php_pcre.c
diff options
context:
space:
mode:
authorDmitry Stogov <dmitry@zend.com>2015-03-20 02:02:42 +0300
committerDmitry Stogov <dmitry@zend.com>2015-03-20 02:02:42 +0300
commitd146d15003442a2e5234dd2fab1605094dc21630 (patch)
tree3a20cd8866a8544ed8bfd04b8c71f7041b4ca91e /ext/pcre/php_pcre.c
parent184793b5c1e7a9df67e542893b69bace5cd7a67c (diff)
downloadphp-git-d146d15003442a2e5234dd2fab1605094dc21630.tar.gz
Optimize zend_string_realloc() add more specialized versions zend_string_extend() and zend_string_truncate()
Diffstat (limited to 'ext/pcre/php_pcre.c')
-rw-r--r--ext/pcre/php_pcre.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/pcre/php_pcre.c b/ext/pcre/php_pcre.c
index 6e769e06f0..8080823b09 100644
--- a/ext/pcre/php_pcre.c
+++ b/ext/pcre/php_pcre.c
@@ -1158,7 +1158,7 @@ PHPAPI zend_string *php_pcre_replace_impl(pcre_cache_entry *pce, zend_string *su
result = zend_string_alloc(alloc_len, 0);
} else {
alloc_len = alloc_len + 2 * new_len;
- result = zend_string_realloc(result, alloc_len, 0);
+ result = zend_string_extend(result, alloc_len, 0);
}
}
/* copy the part of the string before the match */
@@ -1779,7 +1779,7 @@ static PHP_FUNCTION(preg_quote)
*q = '\0';
/* Reallocate string and return it */
- out_str = zend_string_realloc(out_str, q - out_str->val, 0);
+ out_str = zend_string_truncate(out_str, q - out_str->val, 0);
RETURN_NEW_STR(out_str);
}
/* }}} */