Lines Matching refs:str

31 ZEND_API void ZEND_FASTCALL smart_str_erealloc(smart_str *str, size_t len)  in smart_str_erealloc()  argument
33 if (UNEXPECTED(!str->s)) { in smart_str_erealloc()
34 str->a = len <= SMART_STR_START_LEN in smart_str_erealloc()
37 str->s = zend_string_alloc(str->a, 0); in smart_str_erealloc()
38 ZSTR_LEN(str->s) = 0; in smart_str_erealloc()
40 str->a = SMART_STR_NEW_LEN(len); in smart_str_erealloc()
41str->s = (zend_string *) erealloc2(str->s, str->a + _ZSTR_HEADER_SIZE + 1, _ZSTR_HEADER_SIZE + ZST… in smart_str_erealloc()
45 ZEND_API void ZEND_FASTCALL smart_str_realloc(smart_str *str, size_t len) in smart_str_realloc() argument
47 if (UNEXPECTED(!str->s)) { in smart_str_realloc()
48 str->a = len <= SMART_STR_START_LEN in smart_str_realloc()
51 str->s = zend_string_alloc(str->a, 1); in smart_str_realloc()
52 ZSTR_LEN(str->s) = 0; in smart_str_realloc()
54 str->a = SMART_STR_NEW_LEN(len); in smart_str_realloc()
55 str->s = (zend_string *) perealloc(str->s, str->a + _ZSTR_HEADER_SIZE + 1, 1); in smart_str_realloc()
78 ZEND_API void ZEND_FASTCALL smart_str_append_escaped(smart_str *str, const char *s, size_t l) { in smart_str_append_escaped() argument
82 smart_str_alloc(str, len, 0); in smart_str_append_escaped()
83 res = &ZSTR_VAL(str->s)[ZSTR_LEN(str->s)]; in smart_str_append_escaped()
84 ZSTR_LEN(str->s) += len; in smart_str_append_escaped()
129 ZEND_API void ZEND_FASTCALL _smart_string_alloc_persistent(smart_string *str, size_t len) in _smart_string_alloc_persistent() argument
131 if (!str->c) { in _smart_string_alloc_persistent()
132 str->len = 0; in _smart_string_alloc_persistent()
134 str->a = SMART_STRING_START_LEN; in _smart_string_alloc_persistent()
136str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
138 str->c = pemalloc(str->a + 1, 1); in _smart_string_alloc_persistent()
140 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc_persistent()
143 len += str->len; in _smart_string_alloc_persistent()
144str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc_persistent()
145 str->c = perealloc(str->c, str->a + 1, 1); in _smart_string_alloc_persistent()
149 ZEND_API void ZEND_FASTCALL _smart_string_alloc(smart_string *str, size_t len) in _smart_string_alloc() argument
151 if (!str->c) { in _smart_string_alloc()
152 str->len = 0; in _smart_string_alloc()
154 str->a = SMART_STRING_START_LEN; in _smart_string_alloc()
155 str->c = emalloc(SMART_STRING_START_LEN + 1); in _smart_string_alloc()
157str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
158 if (EXPECTED(str->a < (ZEND_MM_CHUNK_SIZE - SMART_STRING_OVERHEAD))) { in _smart_string_alloc()
159 str->c = emalloc_large(str->a + 1); in _smart_string_alloc()
162 str->c = emalloc(str->a + 1); in _smart_string_alloc()
166 if (UNEXPECTED((size_t) len > SIZE_MAX - str->len)) { in _smart_string_alloc()
169 len += str->len; in _smart_string_alloc()
170str->a = ZEND_MM_ALIGNED_SIZE_EX(len + SMART_STRING_OVERHEAD, SMART_STRING_PAGE) - SMART_STRING_OV… in _smart_string_alloc()
171 str->c = erealloc2(str->c, str->a + 1, str->len); in _smart_string_alloc()