Lines Matching refs:str
30 ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len) in smart_str_erealloc() argument
32 if (UNEXPECTED(!str->s)) { in smart_str_erealloc()
33 str->a = len <= SMART_STR_START_LEN in smart_str_erealloc()
36 str->s = zend_string_alloc(str->a, 0); in smart_str_erealloc()
37 ZSTR_LEN(str->s) = 0; in smart_str_erealloc()
39 str->a = SMART_STR_NEW_LEN(len); in smart_str_erealloc()
40 …str->s = (zend_string *) erealloc2(str->s, str->a + _ZSTR_HEADER_SIZE + 1, _ZSTR_HEADER_SIZE + ZST… in smart_str_erealloc()
44 ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len) in smart_str_realloc() argument
46 if (UNEXPECTED(!str->s)) { in smart_str_realloc()
47 str->a = len <= SMART_STR_START_LEN in smart_str_realloc()
50 str->s = zend_string_alloc(str->a, 1); in smart_str_realloc()
51 ZSTR_LEN(str->s) = 0; in smart_str_realloc()
53 str->a = SMART_STR_NEW_LEN(len); in smart_str_realloc()
54 str->s = (zend_string *) perealloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1, 1); in smart_str_realloc()
77 ZEND_API void ZEND_FASTCALL smart_str_append_escaped(smart_str *str, const char *s, size_t l) { in smart_str_append_escaped() argument
81 smart_str_alloc(str, len, 0); in smart_str_append_escaped()
82 res = &ZSTR_VAL(str->s)[ZSTR_LEN(str->s)]; in smart_str_append_escaped()
83 ZSTR_LEN(str->s) += len; in smart_str_append_escaped()
117 smart_str *str, double num, int precision, bool zero_fraction) { in smart_str_append_double() argument
121 smart_str_appends(str, buf); in smart_str_append_double()
123 smart_str_appendl(str, ".0", 2); in smart_str_append_double()
139 ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str, size_t len) in _smart_string_alloc_persistent() argument
141 if (!str->c) { in _smart_string_alloc_persistent()
142 str->len = 0; in _smart_string_alloc_persistent()
144 str->a = SMART_STRING_START_LEN; in _smart_string_alloc_persistent()
146 …str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
148 str->c = pemalloc(str->a + 1, 1); in _smart_string_alloc_persistent()
150 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc_persistent()
153 len += str->len; in _smart_string_alloc_persistent()
154 …str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
155 str->c = perealloc(str->c, str->a + 1, 1); in _smart_string_alloc_persistent()
159 ZEND_API void ZEND_FASTCALL _smart_string_alloc(smart_string *str, size_t len) in _smart_string_alloc() argument
161 if (!str->c) { in _smart_string_alloc()
162 str->len = 0; in _smart_string_alloc()
164 str->a = SMART_STRING_START_LEN; in _smart_string_alloc()
165 str->c = emalloc(SMART_STRING_START_LEN + 1); in _smart_string_alloc()
167 …str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
168 if (EXPECTED(str->a < (ZEND_MM_CHUNK_SIZE - SMART_STRING_OVERHEAD))) { in _smart_string_alloc()
169 str->c = emalloc_large(str->a + 1); in _smart_string_alloc()
172 str->c = emalloc(str->a + 1); in _smart_string_alloc()
176 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc()
179 len += str->len; in _smart_string_alloc()
180 …str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
181 str->c = erealloc2(str->c, str->a + 1, str->len); in _smart_string_alloc()
185 ZEND_API void ZEND_FASTCALL smart_str_append_escaped_truncated(smart_str *str, const zend_string *v… in smart_str_append_escaped_truncated() argument
187 smart_str_append_escaped(str, ZSTR_VAL(value), MIN(length, ZSTR_LEN(value))); in smart_str_append_escaped_truncated()
190 smart_str_appendl(str, "...", sizeof("...")-1); in smart_str_append_escaped_truncated()