Lines Matching refs:str
29 static zend_string* ZEND_FASTCALL zend_new_interned_string_permanent(zend_string *str);
30 static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *str);
31 static zend_string* ZEND_FASTCALL zend_string_init_interned_permanent(const char *str, size_t size,…
32 static zend_string* ZEND_FASTCALL zend_string_init_interned_request(const char *str, size_t size, i…
49 ZEND_API zend_ulong ZEND_FASTCALL zend_string_hash_func(zend_string *str) in zend_string_hash_func() argument
51 return ZSTR_H(str) = zend_hash_func(ZSTR_VAL(str), ZSTR_LEN(str)); in zend_string_hash_func()
54 ZEND_API zend_ulong ZEND_FASTCALL zend_hash_func(const char *str, size_t len) in zend_hash_func() argument
56 return zend_inline_hash_func(str, len); in zend_hash_func()
61 zend_string *str = Z_STR_P(zv); in _str_dtor() local
62 pefree(str, GC_FLAGS(str) & IS_STR_PERSISTENT); in _str_dtor()
66 #define _ZEND_STR_DSC(id, str) str, argument
82 zend_string *str; in zend_interned_strings_init() local
98 str = zend_string_alloc(sizeof("")-1, 1); in zend_interned_strings_init()
99 ZSTR_VAL(str)[0] = '\000'; in zend_interned_strings_init() local
100 zend_empty_string = zend_new_interned_string_permanent(str); in zend_interned_strings_init()
111 str = zend_string_init(known_strings[i], strlen(known_strings[i]), 1); in zend_interned_strings_init()
112 zend_known_strings[i] = zend_new_interned_string_permanent(str); in zend_interned_strings_init()
124 …e zend_string *zend_interned_string_ht_lookup_ex(zend_ulong h, const char *str, size_t size, HashT… in zend_interned_string_ht_lookup_ex() argument
135 if (!memcmp(ZSTR_VAL(p->key), str, size)) { in zend_interned_string_ht_lookup_ex()
145 static zend_always_inline zend_string *zend_interned_string_ht_lookup(zend_string *str, HashTable *… in zend_interned_string_ht_lookup() argument
147 zend_ulong h = ZSTR_H(str); in zend_interned_string_ht_lookup()
156 if ((p->h == h) && zend_string_equal_content(p->key, str)) { in zend_interned_string_ht_lookup()
167 static zend_always_inline zend_string *zend_add_interned_string(zend_string *str, HashTable *intern… in zend_add_interned_string() argument
171 GC_SET_REFCOUNT(str, 1); in zend_add_interned_string()
172 GC_ADD_FLAGS(str, IS_STR_INTERNED | flags); in zend_add_interned_string()
174 ZVAL_INTERNED_STR(&val, str); in zend_add_interned_string()
176 zend_hash_add_new(interned_strings, str, &val); in zend_add_interned_string()
178 return str; in zend_add_interned_string()
181 ZEND_API zend_string* ZEND_FASTCALL zend_interned_string_find_permanent(zend_string *str) in zend_interned_string_find_permanent() argument
183 zend_string_hash_val(str); in zend_interned_string_find_permanent()
184 return zend_interned_string_ht_lookup(str, &interned_strings_permanent); in zend_interned_string_find_permanent()
187 static zend_string* ZEND_FASTCALL zend_new_interned_string_permanent(zend_string *str) in zend_new_interned_string_permanent() argument
191 if (ZSTR_IS_INTERNED(str)) { in zend_new_interned_string_permanent()
192 return str; in zend_new_interned_string_permanent()
195 zend_string_hash_val(str); in zend_new_interned_string_permanent()
196 ret = zend_interned_string_ht_lookup(str, &interned_strings_permanent); in zend_new_interned_string_permanent()
198 zend_string_release(str); in zend_new_interned_string_permanent()
202 ZEND_ASSERT(GC_FLAGS(str) & GC_PERSISTENT); in zend_new_interned_string_permanent()
203 if (GC_REFCOUNT(str) > 1) { in zend_new_interned_string_permanent()
204 zend_ulong h = ZSTR_H(str); in zend_new_interned_string_permanent()
205 zend_string_delref(str); in zend_new_interned_string_permanent()
206 str = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 1); in zend_new_interned_string_permanent()
207 ZSTR_H(str) = h; in zend_new_interned_string_permanent()
210 return zend_add_interned_string(str, &interned_strings_permanent, IS_STR_PERMANENT); in zend_new_interned_string_permanent()
213 static zend_string* ZEND_FASTCALL zend_new_interned_string_request(zend_string *str) in zend_new_interned_string_request() argument
217 if (ZSTR_IS_INTERNED(str)) { in zend_new_interned_string_request()
218 return str; in zend_new_interned_string_request()
221 zend_string_hash_val(str); in zend_new_interned_string_request()
224 ret = zend_interned_string_ht_lookup(str, &interned_strings_permanent); in zend_new_interned_string_request()
226 zend_string_release(str); in zend_new_interned_string_request()
230 ret = zend_interned_string_ht_lookup(str, &CG(interned_strings)); in zend_new_interned_string_request()
232 zend_string_release(str); in zend_new_interned_string_request()
241 ZEND_ASSERT(!(GC_FLAGS(str) & GC_PERSISTENT)); in zend_new_interned_string_request()
244 if (GC_REFCOUNT(str) > 1) { in zend_new_interned_string_request()
245 zend_ulong h = ZSTR_H(str); in zend_new_interned_string_request()
246 zend_string_delref(str); in zend_new_interned_string_request()
247 str = zend_string_init(ZSTR_VAL(str), ZSTR_LEN(str), 0); in zend_new_interned_string_request()
248 ZSTR_H(str) = h; in zend_new_interned_string_request()
251 ret = zend_add_interned_string(str, &CG(interned_strings), 0); in zend_new_interned_string_request()
256 static zend_string* ZEND_FASTCALL zend_string_init_interned_permanent(const char *str, size_t size,… in zend_string_init_interned_permanent() argument
259 zend_ulong h = zend_inline_hash_func(str, size); in zend_string_init_interned_permanent()
261 ret = zend_interned_string_ht_lookup_ex(h, str, size, &interned_strings_permanent); in zend_string_init_interned_permanent()
267 ret = zend_string_init(str, size, permanent); in zend_string_init_interned_permanent()
272 static zend_string* ZEND_FASTCALL zend_string_init_interned_request(const char *str, size_t size, i… in zend_string_init_interned_request() argument
275 zend_ulong h = zend_inline_hash_func(str, size); in zend_string_init_interned_request()
278 ret = zend_interned_string_ht_lookup_ex(h, str, size, &interned_strings_permanent); in zend_string_init_interned_request()
283 ret = zend_interned_string_ht_lookup_ex(h, str, size, &CG(interned_strings)); in zend_string_init_interned_request()
295 ret = zend_string_init(str, size, permanent); in zend_string_init_interned_request()