com php-src: Switch to ZMM routines, closes #2917: Zend/zend_ smart_str.c
| From: | Anatol Belski | Date: | Tue, 21 Nov 2017 18:38:53 +0000 |
| Subject: | com php-src: Switch to ZMM routines, closes #2917: Zend/zend_ smart_str.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-100323@lists.php.net to get a copy of this message | ||
Commit: 12b2c2f5f9f3f31f6276aac35365932d9032e839
Author: Anatol Belski <ab@php.net> Tue, 21 Nov 2017 19:38:53 +0100
Parents: 6b54b3409a46119bc702af5d905718a88a0115a3
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=12b2c2f5f9f3f31f6276aac35365932d9032e839
Log:
Switch to ZMM routines, closes #2917
Bugs:
https://bugs.php.net/2917
Changed paths:
M Zend/zend_smart_str.c
Diff:
diff --git a/Zend/zend_smart_str.c b/Zend/zend_smart_str.c
index 74feea4..cf7c40b 100644
--- a/Zend/zend_smart_str.c
+++ b/Zend/zend_smart_str.c
@@ -52,7 +52,7 @@ ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len)
ZSTR_LEN(str->s) = 0;
} else {
str->a = SMART_STR_NEW_LEN(len);
- str->s = (zend_string *) realloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1);
+ str->s = (zend_string *) perealloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1, 1);
}
}
@@ -135,14 +135,14 @@ ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str,
si
} else {
str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) -
SMART_STRING_OVERHEAD;
}
- str->c = malloc(str->a + 1);
+ str->c = pemalloc(str->a + 1, 1);
} else {
if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) {
zend_error(E_ERROR, "String size overflow");
}
len += str->len;
str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) -
SMART_STRING_OVERHEAD;
- str->c = realloc(str->c, str->a + 1);
+ str->c = perealloc(str->c, str->a + 1, 1);
}
}