Lines Matching refs:str

29 ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len)  in smart_str_erealloc()  argument
31 if (UNEXPECTED(!str->s)) { in smart_str_erealloc()
32 str->a = len <= SMART_STR_START_LEN in smart_str_erealloc()
35 str->s = zend_string_alloc(str->a, 0); in smart_str_erealloc()
36 ZSTR_LEN(str->s) = 0; in smart_str_erealloc()
38 str->a = SMART_STR_NEW_LEN(len); in smart_str_erealloc()
39str->s = (zend_string *) erealloc2(str->s, str->a + _ZSTR_HEADER_SIZE + 1, _ZSTR_HEADER_SIZE + ZST… in smart_str_erealloc()
43 ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len) in smart_str_realloc() argument
45 if (UNEXPECTED(!str->s)) { in smart_str_realloc()
46 str->a = len <= SMART_STR_START_LEN in smart_str_realloc()
49 str->s = zend_string_alloc(str->a, 1); in smart_str_realloc()
50 ZSTR_LEN(str->s) = 0; in smart_str_realloc()
52 str->a = SMART_STR_NEW_LEN(len); in smart_str_realloc()
53 str->s = (zend_string *) perealloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1, 1); in smart_str_realloc()
76 ZEND_API void ZEND_FASTCALL smart_str_append_escaped(smart_str *str, const char *s, size_t l) { in smart_str_append_escaped() argument
80 smart_str_alloc(str, len, 0); in smart_str_append_escaped()
81 res = &ZSTR_VAL(str->s)[ZSTR_LEN(str->s)]; in smart_str_append_escaped()
82 ZSTR_LEN(str->s) += len; in smart_str_append_escaped()
116 smart_str *str, double num, int precision, bool zero_fraction) { in smart_str_append_double() argument
120 smart_str_appends(str, buf); in smart_str_append_double()
122 smart_str_appendl(str, ".0", 2); in smart_str_append_double()
138 ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str, size_t len) in _smart_string_alloc_persistent() argument
140 if (!str->c) { in _smart_string_alloc_persistent()
141 str->len = 0; in _smart_string_alloc_persistent()
143 str->a = SMART_STRING_START_LEN; in _smart_string_alloc_persistent()
145str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
147 str->c = pemalloc(str->a + 1, 1); in _smart_string_alloc_persistent()
149 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc_persistent()
152 len += str->len; in _smart_string_alloc_persistent()
153str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
154 str->c = perealloc(str->c, str->a + 1, 1); in _smart_string_alloc_persistent()
158 ZEND_API void ZEND_FASTCALL _smart_string_alloc(smart_string *str, size_t len) in _smart_string_alloc() argument
160 if (!str->c) { in _smart_string_alloc()
161 str->len = 0; in _smart_string_alloc()
163 str->a = SMART_STRING_START_LEN; in _smart_string_alloc()
164 str->c = emalloc(SMART_STRING_START_LEN + 1); in _smart_string_alloc()
166str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
167 if (EXPECTED(str->a < (ZEND_MM_CHUNK_SIZE - SMART_STRING_OVERHEAD))) { in _smart_string_alloc()
168 str->c = emalloc_large(str->a + 1); in _smart_string_alloc()
171 str->c = emalloc(str->a + 1); in _smart_string_alloc()
175 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc()
178 len += str->len; in _smart_string_alloc()
179str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
180 str->c = erealloc2(str->c, str->a + 1, str->len); in _smart_string_alloc()
184 ZEND_API void ZEND_FASTCALL smart_str_append_escaped_truncated(smart_str *str, const zend_string *v… in smart_str_append_escaped_truncated() argument
186 smart_str_append_escaped(str, ZSTR_VAL(value), MIN(length, ZSTR_LEN(value))); in smart_str_append_escaped_truncated()
189 smart_str_appendl(str, "...", sizeof("...")-1); in smart_str_append_escaped_truncated()