Lines Matching refs:ht
51 #define HT_FLAGS(ht) (ht)->u.flags argument
53 #define HT_INVALIDATE(ht) do { \ argument
54 HT_FLAGS(ht) = HASH_FLAG_UNINITIALIZED; \
57 #define HT_IS_INITIALIZED(ht) \ argument
58 ((HT_FLAGS(ht) & HASH_FLAG_UNINITIALIZED) == 0)
60 #define HT_IS_PACKED(ht) \ argument
61 ((HT_FLAGS(ht) & HASH_FLAG_PACKED) != 0)
63 #define HT_IS_WITHOUT_HOLES(ht) \ argument
64 ((ht)->nNumUsed == (ht)->nNumOfElements)
66 #define HT_HAS_STATIC_KEYS_ONLY(ht) \ argument
67 ((HT_FLAGS(ht) & (HASH_FLAG_PACKED|HASH_FLAG_STATIC_KEYS)) != 0)
70 # define HT_ALLOW_COW_VIOLATION(ht) HT_FLAGS(ht) |= HASH_FLAG_ALLOW_COW_VIOLATION argument
72 # define HT_ALLOW_COW_VIOLATION(ht) argument
75 #define HT_ITERATORS_COUNT(ht) (ht)->u.v.nIteratorsCount argument
76 #define HT_ITERATORS_OVERFLOW(ht) (HT_ITERATORS_COUNT(ht) == 0xff) argument
77 #define HT_HAS_ITERATORS(ht) (HT_ITERATORS_COUNT(ht) != 0) argument
79 #define HT_SET_ITERATORS_COUNT(ht, iters) \ argument
80 do { HT_ITERATORS_COUNT(ht) = (iters); } while (0)
81 #define HT_INC_ITERATORS_COUNT(ht) \ argument
82 HT_SET_ITERATORS_COUNT(ht, HT_ITERATORS_COUNT(ht) + 1)
83 #define HT_DEC_ITERATORS_COUNT(ht) \ argument
84 HT_SET_ITERATORS_COUNT(ht, HT_ITERATORS_COUNT(ht) - 1)
105 ZEND_API void ZEND_FASTCALL _zend_hash_init(HashTable *ht, uint32_t nSize, dtor_func_t pDestructor,…
106 ZEND_API void ZEND_FASTCALL zend_hash_destroy(HashTable *ht);
107 ZEND_API void ZEND_FASTCALL zend_hash_clean(HashTable *ht);
109 #define zend_hash_init(ht, nSize, pHashFunction, pDestructor, persistent) \ argument
110 _zend_hash_init((ht), (nSize), (pDestructor), (persistent))
112 ZEND_API void ZEND_FASTCALL zend_hash_real_init(HashTable *ht, bool packed);
113 ZEND_API void ZEND_FASTCALL zend_hash_real_init_packed(HashTable *ht);
114 ZEND_API void ZEND_FASTCALL zend_hash_real_init_mixed(HashTable *ht);
115 ZEND_API void ZEND_FASTCALL zend_hash_packed_to_hash(HashTable *ht);
116 ZEND_API void ZEND_FASTCALL zend_hash_to_packed(HashTable *ht);
117 ZEND_API void ZEND_FASTCALL zend_hash_extend(HashTable *ht, uint32_t nSize, bool packed);
118 ZEND_API void ZEND_FASTCALL zend_hash_discard(HashTable *ht, uint32_t nNumUsed);
119 ZEND_API void ZEND_FASTCALL zend_hash_packed_grow(HashTable *ht);
122 ZEND_API zval* ZEND_FASTCALL zend_hash_add_or_update(HashTable *ht, zend_string *key, zval *pData, …
123 ZEND_API zval* ZEND_FASTCALL zend_hash_update(HashTable *ht, zend_string *key,zval *pData);
124 ZEND_API zval* ZEND_FASTCALL zend_hash_update_ind(HashTable *ht, zend_string *key,zval *pData);
125 ZEND_API zval* ZEND_FASTCALL zend_hash_add(HashTable *ht, zend_string *key,zval *pData);
126 ZEND_API zval* ZEND_FASTCALL zend_hash_add_new(HashTable *ht, zend_string *key,zval *pData);
128 ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_or_update(HashTable *ht, const char *key, size_t len…
129 ZEND_API zval* ZEND_FASTCALL zend_hash_str_update(HashTable *ht, const char *key, size_t len, zval …
130 ZEND_API zval* ZEND_FASTCALL zend_hash_str_update_ind(HashTable *ht, const char *key, size_t len, z…
131 ZEND_API zval* ZEND_FASTCALL zend_hash_str_add(HashTable *ht, const char *key, size_t len, zval *pD…
132 ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_new(HashTable *ht, const char *key, size_t len, zval…
134 ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_or_update(HashTable *ht, zend_ulong h, zval *pData…
135 ZEND_API zval* ZEND_FASTCALL zend_hash_index_add(HashTable *ht, zend_ulong h, zval *pData);
136 ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_new(HashTable *ht, zend_ulong h, zval *pData);
137 ZEND_API zval* ZEND_FASTCALL zend_hash_index_update(HashTable *ht, zend_ulong h, zval *pData);
138 ZEND_API zval* ZEND_FASTCALL zend_hash_next_index_insert(HashTable *ht, zval *pData);
139 ZEND_API zval* ZEND_FASTCALL zend_hash_next_index_insert_new(HashTable *ht, zval *pData);
141 ZEND_API zval* ZEND_FASTCALL zend_hash_index_add_empty_element(HashTable *ht, zend_ulong h);
142 ZEND_API zval* ZEND_FASTCALL zend_hash_add_empty_element(HashTable *ht, zend_string *key);
143 ZEND_API zval* ZEND_FASTCALL zend_hash_str_add_empty_element(HashTable *ht, const char *key, size_t…
145 ZEND_API zval* ZEND_FASTCALL zend_hash_set_bucket_key(HashTable *ht, Bucket *p, zend_string *key);
155 ZEND_API void ZEND_FASTCALL zend_hash_graceful_destroy(HashTable *ht);
156 ZEND_API void ZEND_FASTCALL zend_hash_graceful_reverse_destroy(HashTable *ht);
157 ZEND_API void ZEND_FASTCALL zend_hash_apply(HashTable *ht, apply_func_t apply_func);
158 ZEND_API void ZEND_FASTCALL zend_hash_apply_with_argument(HashTable *ht, apply_func_arg_t apply_fun…
159 ZEND_API void zend_hash_apply_with_arguments(HashTable *ht, apply_func_args_t apply_func, int, ...);
167 ZEND_API void ZEND_FASTCALL zend_hash_reverse_apply(HashTable *ht, apply_func_t apply_func);
171 ZEND_API zend_result ZEND_FASTCALL zend_hash_del(HashTable *ht, zend_string *key);
172 ZEND_API zend_result ZEND_FASTCALL zend_hash_del_ind(HashTable *ht, zend_string *key);
173 ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del(HashTable *ht, const char *key, size_t len);
174 ZEND_API zend_result ZEND_FASTCALL zend_hash_str_del_ind(HashTable *ht, const char *key, size_t len…
175 ZEND_API zend_result ZEND_FASTCALL zend_hash_index_del(HashTable *ht, zend_ulong h);
176 ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p);
177 ZEND_API void ZEND_FASTCALL zend_hash_packed_del_val(HashTable *ht, zval *zv);
180 ZEND_API zval* ZEND_FASTCALL zend_hash_find(const HashTable *ht, zend_string *key);
181 ZEND_API zval* ZEND_FASTCALL zend_hash_str_find(const HashTable *ht, const char *key, size_t len);
182 ZEND_API zval* ZEND_FASTCALL zend_hash_index_find(const HashTable *ht, zend_ulong h);
183 ZEND_API zval* ZEND_FASTCALL _zend_hash_index_find(const HashTable *ht, zend_ulong h);
186 ZEND_API zval* ZEND_FASTCALL zend_hash_find_known_hash(const HashTable *ht, const zend_string *key);
188 static zend_always_inline zval *zend_hash_find_ex(const HashTable *ht, zend_string *key, bool known… in zend_hash_find_ex() argument
191 return zend_hash_find_known_hash(ht, key); in zend_hash_find_ex()
193 return zend_hash_find(ht, key); in zend_hash_find_ex()
217 ZEND_API zval* ZEND_FASTCALL zend_hash_lookup(HashTable *ht, zend_string *key);
218 ZEND_API zval* ZEND_FASTCALL zend_hash_index_lookup(HashTable *ht, zend_ulong h);
233 static zend_always_inline bool zend_hash_exists(const HashTable *ht, zend_string *key) in zend_hash_exists() argument
235 return zend_hash_find(ht, key) != NULL; in zend_hash_exists()
238 static zend_always_inline bool zend_hash_str_exists(const HashTable *ht, const char *str, size_t le… in zend_hash_str_exists() argument
240 return zend_hash_str_find(ht, str, len) != NULL; in zend_hash_str_exists()
243 static zend_always_inline bool zend_hash_index_exists(const HashTable *ht, zend_ulong h) in zend_hash_index_exists() argument
245 return zend_hash_index_find(ht, h) != NULL; in zend_hash_index_exists()
249 ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos_ex(const HashTable *ht, HashPosition …
250 ZEND_API HashPosition ZEND_FASTCALL zend_hash_get_current_pos(const HashTable *ht);
252 ZEND_API zend_result ZEND_FASTCALL zend_hash_move_forward_ex(const HashTable *ht, HashPosition *p…
253 ZEND_API zend_result ZEND_FASTCALL zend_hash_move_backwards_ex(const HashTable *ht, HashPosition …
254 ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_ex(const HashTable *ht, zend_string **str_in…
255 ZEND_API void ZEND_FASTCALL zend_hash_get_current_key_zval_ex(const HashTable *ht, zval *key, cons…
256 ZEND_API int ZEND_FASTCALL zend_hash_get_current_key_type_ex(const HashTable *ht, const HashPosit…
257 ZEND_API zval* ZEND_FASTCALL zend_hash_get_current_data_ex(const HashTable *ht, const HashPosition …
258 ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_reset_ex(const HashTable *ht, HashPosition …
259 ZEND_API void ZEND_FASTCALL zend_hash_internal_pointer_end_ex(const HashTable *ht, HashPosition *p…
261 static zend_always_inline zend_result zend_hash_has_more_elements_ex(const HashTable *ht, const Has… in zend_hash_has_more_elements_ex() argument
262 return (zend_hash_get_current_key_type_ex(ht, pos) == HASH_KEY_NON_EXISTENT ? FAILURE : SUCCESS); in zend_hash_has_more_elements_ex()
264 static zend_always_inline zend_result zend_hash_has_more_elements(HashTable *ht) { in zend_hash_has_more_elements() argument
265 return zend_hash_has_more_elements_ex(ht, &ht->nInternalPointer); in zend_hash_has_more_elements()
267 static zend_always_inline zend_result zend_hash_move_forward(HashTable *ht) { in zend_hash_move_forward() argument
268 return zend_hash_move_forward_ex(ht, &ht->nInternalPointer); in zend_hash_move_forward()
270 static zend_always_inline zend_result zend_hash_move_backwards(HashTable *ht) { in zend_hash_move_backwards() argument
271 return zend_hash_move_backwards_ex(ht, &ht->nInternalPointer); in zend_hash_move_backwards()
273 static zend_always_inline int zend_hash_get_current_key(const HashTable *ht, zend_string **str_inde… in zend_hash_get_current_key() argument
274 return zend_hash_get_current_key_ex(ht, str_index, num_index, &ht->nInternalPointer); in zend_hash_get_current_key()
276 static zend_always_inline void zend_hash_get_current_key_zval(const HashTable *ht, zval *key) { in zend_hash_get_current_key_zval() argument
277 zend_hash_get_current_key_zval_ex(ht, key, &ht->nInternalPointer); in zend_hash_get_current_key_zval()
279 static zend_always_inline int zend_hash_get_current_key_type(const HashTable *ht) { in zend_hash_get_current_key_type() argument
280 return zend_hash_get_current_key_type_ex(ht, &ht->nInternalPointer); in zend_hash_get_current_key_type()
282 static zend_always_inline zval* zend_hash_get_current_data(const HashTable *ht) { in zend_hash_get_current_data() argument
283 return zend_hash_get_current_data_ex(ht, &ht->nInternalPointer); in zend_hash_get_current_data()
285 static zend_always_inline void zend_hash_internal_pointer_reset(HashTable *ht) { in zend_hash_internal_pointer_reset() argument
286 zend_hash_internal_pointer_reset_ex(ht, &ht->nInternalPointer); in zend_hash_internal_pointer_reset()
288 static zend_always_inline void zend_hash_internal_pointer_end(HashTable *ht) { in zend_hash_internal_pointer_end() argument
289 zend_hash_internal_pointer_end_ex(ht, &ht->nInternalPointer); in zend_hash_internal_pointer_end()
302 ZEND_API void ZEND_FASTCALL zend_hash_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compare…
303 ZEND_API void ZEND_FASTCALL zend_array_sort_ex(HashTable *ht, sort_func_t sort_func, bucket_compar…
304 ZEND_API zval* ZEND_FASTCALL zend_hash_minmax(const HashTable *ht, compare_func_t compar, uint32_t …
306 static zend_always_inline void ZEND_FASTCALL zend_hash_sort(HashTable *ht, bucket_compare_func_t co… in zend_hash_sort() argument
307 zend_hash_sort_ex(ht, zend_sort, compare_func, renumber); in zend_hash_sort()
313 static zend_always_inline void zend_array_sort(HashTable *ht, bucket_compare_func_t compare_func, b… in zend_array_sort() argument
314 zend_array_sort_ex(ht, zend_sort, compare_func, renumber); in zend_array_sort()
317 static zend_always_inline uint32_t zend_hash_num_elements(const HashTable *ht) { in zend_hash_num_elements() argument
318 return ht->nNumOfElements; in zend_hash_num_elements()
321 static zend_always_inline zend_long zend_hash_next_free_element(const HashTable *ht) { in zend_hash_next_free_element() argument
322 return ht->nNextFreeElement; in zend_hash_next_free_element()
325 ZEND_API void ZEND_FASTCALL zend_hash_rehash(HashTable *ht);
346 ZEND_API uint32_t zend_array_count(HashTable *ht);
348 ZEND_API void ZEND_FASTCALL zend_array_destroy(HashTable *ht);
350 ZEND_API void ZEND_FASTCALL zend_symtable_clean(HashTable *ht);
351 ZEND_API HashTable* ZEND_FASTCALL zend_symtable_to_proptable(HashTable *ht);
352 ZEND_API HashTable* ZEND_FASTCALL zend_proptable_to_symtable(HashTable *ht, bool always_duplicate);
356 ZEND_API uint32_t ZEND_FASTCALL zend_hash_iterator_add(HashTable *ht, HashPosition pos);
357 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht);
360 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterators_lower_pos(const HashTable *ht, HashPosition…
361 ZEND_API void ZEND_FASTCALL _zend_hash_iterators_update(const HashTable *ht, HashPosition f…
362 ZEND_API void ZEND_FASTCALL zend_hash_iterators_advance(const HashTable *ht, HashPosition s…
364 static zend_always_inline void zend_hash_iterators_update(const HashTable *ht, HashPosition from, H… in zend_hash_iterators_update() argument
366 if (UNEXPECTED(HT_HAS_ITERATORS(ht))) { in zend_hash_iterators_update()
367 _zend_hash_iterators_update(ht, from, to); in zend_hash_iterators_update()
394 #define ZEND_INIT_SYMTABLE(ht) \ in END_EXTERN_C() argument
395 ZEND_INIT_SYMTABLE_EX(ht, 8, 0) in END_EXTERN_C()
397 #define ZEND_INIT_SYMTABLE_EX(ht, n, persistent) \ in END_EXTERN_C() argument
398 zend_hash_init(ht, n, NULL, ZVAL_PTR_DTOR, persistent) in END_EXTERN_C()
425 static zend_always_inline zval *zend_hash_find_ind(const HashTable *ht, zend_string *key) in zend_hash_find_ind() argument
429 zv = zend_hash_find(ht, key); in zend_hash_find_ind()
435 static zend_always_inline zval *zend_hash_find_ex_ind(const HashTable *ht, zend_string *key, bool k… in zend_hash_find_ex_ind() argument
439 zv = zend_hash_find_ex(ht, key, known_hash); in zend_hash_find_ex_ind()
445 static zend_always_inline bool zend_hash_exists_ind(const HashTable *ht, zend_string *key) in zend_hash_exists_ind() argument
449 zv = zend_hash_find(ht, key); in zend_hash_exists_ind()
455 static zend_always_inline zval *zend_hash_str_find_ind(const HashTable *ht, const char *str, size_t… in zend_hash_str_find_ind() argument
459 zv = zend_hash_str_find(ht, str, len); in zend_hash_str_find_ind()
465 static zend_always_inline bool zend_hash_str_exists_ind(const HashTable *ht, const char *str, size_… in zend_hash_str_exists_ind() argument
469 zv = zend_hash_str_find(ht, str, len); in zend_hash_str_exists_ind()
474 static zend_always_inline zval *zend_symtable_add_new(HashTable *ht, zend_string *key, zval *pData) in zend_symtable_add_new() argument
479 return zend_hash_index_add_new(ht, idx, pData); in zend_symtable_add_new()
481 return zend_hash_add_new(ht, key, pData); in zend_symtable_add_new()
485 static zend_always_inline zval *zend_symtable_update(HashTable *ht, zend_string *key, zval *pData) in zend_symtable_update() argument
490 return zend_hash_index_update(ht, idx, pData); in zend_symtable_update()
492 return zend_hash_update(ht, key, pData); in zend_symtable_update()
497 static zend_always_inline zval *zend_symtable_update_ind(HashTable *ht, zend_string *key, zval *pDa… in zend_symtable_update_ind() argument
502 return zend_hash_index_update(ht, idx, pData); in zend_symtable_update_ind()
504 return zend_hash_update_ind(ht, key, pData); in zend_symtable_update_ind()
509 static zend_always_inline zend_result zend_symtable_del(HashTable *ht, zend_string *key) in zend_symtable_del() argument
514 return zend_hash_index_del(ht, idx); in zend_symtable_del()
516 return zend_hash_del(ht, key); in zend_symtable_del()
521 static zend_always_inline zend_result zend_symtable_del_ind(HashTable *ht, zend_string *key) in zend_symtable_del_ind() argument
526 return zend_hash_index_del(ht, idx); in zend_symtable_del_ind()
528 return zend_hash_del_ind(ht, key); in zend_symtable_del_ind()
533 static zend_always_inline zval *zend_symtable_find(const HashTable *ht, zend_string *key) in zend_symtable_find() argument
538 return zend_hash_index_find(ht, idx); in zend_symtable_find()
540 return zend_hash_find(ht, key); in zend_symtable_find()
545 static zend_always_inline zval *zend_symtable_find_ind(const HashTable *ht, zend_string *key) in zend_symtable_find_ind() argument
550 return zend_hash_index_find(ht, idx); in zend_symtable_find_ind()
552 return zend_hash_find_ind(ht, key); in zend_symtable_find_ind()
557 static zend_always_inline bool zend_symtable_exists(HashTable *ht, zend_string *key) in zend_symtable_exists() argument
562 return zend_hash_index_exists(ht, idx); in zend_symtable_exists()
564 return zend_hash_exists(ht, key); in zend_symtable_exists()
569 static zend_always_inline bool zend_symtable_exists_ind(HashTable *ht, zend_string *key) in zend_symtable_exists_ind() argument
574 return zend_hash_index_exists(ht, idx); in zend_symtable_exists_ind()
576 return zend_hash_exists_ind(ht, key); in zend_symtable_exists_ind()
581 static zend_always_inline zval *zend_symtable_str_update(HashTable *ht, const char *str, size_t len… in zend_symtable_str_update() argument
586 return zend_hash_index_update(ht, idx, pData); in zend_symtable_str_update()
588 return zend_hash_str_update(ht, str, len, pData); in zend_symtable_str_update()
593 static zend_always_inline zval *zend_symtable_str_update_ind(HashTable *ht, const char *str, size_t… in zend_symtable_str_update_ind() argument
598 return zend_hash_index_update(ht, idx, pData); in zend_symtable_str_update_ind()
600 return zend_hash_str_update_ind(ht, str, len, pData); in zend_symtable_str_update_ind()
605 static zend_always_inline zend_result zend_symtable_str_del(HashTable *ht, const char *str, size_t … in zend_symtable_str_del() argument
610 return zend_hash_index_del(ht, idx); in zend_symtable_str_del()
612 return zend_hash_str_del(ht, str, len); in zend_symtable_str_del()
617 static zend_always_inline zend_result zend_symtable_str_del_ind(HashTable *ht, const char *str, siz… in zend_symtable_str_del_ind() argument
622 return zend_hash_index_del(ht, idx); in zend_symtable_str_del_ind()
624 return zend_hash_str_del_ind(ht, str, len); in zend_symtable_str_del_ind()
629 static zend_always_inline zval *zend_symtable_str_find(HashTable *ht, const char *str, size_t len) in zend_symtable_str_find() argument
634 return zend_hash_index_find(ht, idx); in zend_symtable_str_find()
636 return zend_hash_str_find(ht, str, len); in zend_symtable_str_find()
641 static zend_always_inline bool zend_symtable_str_exists(HashTable *ht, const char *str, size_t len) in zend_symtable_str_exists() argument
646 return zend_hash_index_exists(ht, idx); in zend_symtable_str_exists()
648 return zend_hash_str_exists(ht, str, len); in zend_symtable_str_exists()
652 static zend_always_inline void *zend_hash_add_ptr(HashTable *ht, zend_string *key, void *pData) in zend_hash_add_ptr() argument
657 zv = zend_hash_add(ht, key, &tmp); in zend_hash_add_ptr()
666 static zend_always_inline void *zend_hash_add_new_ptr(HashTable *ht, zend_string *key, void *pData) in zend_hash_add_new_ptr() argument
671 zv = zend_hash_add_new(ht, key, &tmp); in zend_hash_add_new_ptr()
680 static zend_always_inline void *zend_hash_str_add_ptr(HashTable *ht, const char *str, size_t len, v… in zend_hash_str_add_ptr() argument
685 zv = zend_hash_str_add(ht, str, len, &tmp); in zend_hash_str_add_ptr()
694 static zend_always_inline void *zend_hash_str_add_new_ptr(HashTable *ht, const char *str, size_t le… in zend_hash_str_add_new_ptr() argument
699 zv = zend_hash_str_add_new(ht, str, len, &tmp); in zend_hash_str_add_new_ptr()
708 static zend_always_inline void *zend_hash_update_ptr(HashTable *ht, zend_string *key, void *pData) in zend_hash_update_ptr() argument
713 zv = zend_hash_update(ht, key, &tmp); in zend_hash_update_ptr()
718 static zend_always_inline void *zend_hash_str_update_ptr(HashTable *ht, const char *str, size_t len… in zend_hash_str_update_ptr() argument
723 zv = zend_hash_str_update(ht, str, len, &tmp); in zend_hash_str_update_ptr()
728 static zend_always_inline void *zend_hash_add_mem(HashTable *ht, zend_string *key, void *pData, siz… in zend_hash_add_mem() argument
733 if ((zv = zend_hash_add(ht, key, &tmp))) { in zend_hash_add_mem()
734 Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_add_mem()
741 static zend_always_inline void *zend_hash_add_new_mem(HashTable *ht, zend_string *key, void *pData,… in zend_hash_add_new_mem() argument
746 if ((zv = zend_hash_add_new(ht, key, &tmp))) { in zend_hash_add_new_mem()
747 Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_add_new_mem()
754 static zend_always_inline void *zend_hash_str_add_mem(HashTable *ht, const char *str, size_t len, v… in zend_hash_str_add_mem() argument
759 if ((zv = zend_hash_str_add(ht, str, len, &tmp))) { in zend_hash_str_add_mem()
760 Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_str_add_mem()
767 static zend_always_inline void *zend_hash_str_add_new_mem(HashTable *ht, const char *str, size_t le… in zend_hash_str_add_new_mem() argument
772 if ((zv = zend_hash_str_add_new(ht, str, len, &tmp))) { in zend_hash_str_add_new_mem()
773 Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_str_add_new_mem()
780 static zend_always_inline void *zend_hash_update_mem(HashTable *ht, zend_string *key, void *pData, … in zend_hash_update_mem() argument
784 p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_update_mem()
786 return zend_hash_update_ptr(ht, key, p); in zend_hash_update_mem()
789 static zend_always_inline void *zend_hash_str_update_mem(HashTable *ht, const char *str, size_t len… in zend_hash_str_update_mem() argument
793 p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_str_update_mem()
795 return zend_hash_str_update_ptr(ht, str, len, p); in zend_hash_str_update_mem()
798 static zend_always_inline void *zend_hash_index_add_ptr(HashTable *ht, zend_ulong h, void *pData) in zend_hash_index_add_ptr() argument
803 zv = zend_hash_index_add(ht, h, &tmp); in zend_hash_index_add_ptr()
807 static zend_always_inline void *zend_hash_index_add_new_ptr(HashTable *ht, zend_ulong h, void *pDat… in zend_hash_index_add_new_ptr() argument
812 zv = zend_hash_index_add_new(ht, h, &tmp); in zend_hash_index_add_new_ptr()
816 static zend_always_inline void *zend_hash_index_update_ptr(HashTable *ht, zend_ulong h, void *pData) in zend_hash_index_update_ptr() argument
821 zv = zend_hash_index_update(ht, h, &tmp); in zend_hash_index_update_ptr()
826 static zend_always_inline void *zend_hash_index_add_mem(HashTable *ht, zend_ulong h, void *pData, s… in zend_hash_index_add_mem() argument
831 if ((zv = zend_hash_index_add(ht, h, &tmp))) { in zend_hash_index_add_mem()
832 Z_PTR_P(zv) = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_index_add_mem()
839 static zend_always_inline void *zend_hash_next_index_insert_ptr(HashTable *ht, void *pData) in zend_hash_next_index_insert_ptr() argument
844 zv = zend_hash_next_index_insert(ht, &tmp); in zend_hash_next_index_insert_ptr()
853 static zend_always_inline void *zend_hash_index_update_mem(HashTable *ht, zend_ulong h, void *pData… in zend_hash_index_update_mem() argument
857 p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_index_update_mem()
859 return zend_hash_index_update_ptr(ht, h, p); in zend_hash_index_update_mem()
862 static zend_always_inline void *zend_hash_next_index_insert_mem(HashTable *ht, void *pData, size_t … in zend_hash_next_index_insert_mem() argument
866 void *p = pemalloc(size, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_next_index_insert_mem()
869 if (!zend_hash_next_index_insert(ht, &tmp)) { in zend_hash_next_index_insert_mem()
870 pefree(p, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in zend_hash_next_index_insert_mem()
876 static zend_always_inline void *zend_hash_find_ptr(const HashTable *ht, zend_string *key) in zend_hash_find_ptr() argument
880 zv = zend_hash_find(ht, key); in zend_hash_find_ptr()
889 static zend_always_inline void *zend_hash_find_ex_ptr(const HashTable *ht, zend_string *key, bool k… in zend_hash_find_ex_ptr() argument
893 zv = zend_hash_find_ex(ht, key, known_hash); in zend_hash_find_ex_ptr()
902 static zend_always_inline void *zend_hash_str_find_ptr(const HashTable *ht, const char *str, size_t… in zend_hash_str_find_ptr() argument
906 zv = zend_hash_str_find(ht, str, len); in zend_hash_str_find_ptr()
919 ZEND_API void *zend_hash_str_find_ptr_lc(const HashTable *ht, const char *str, size_t len);
923 ZEND_API void *zend_hash_find_ptr_lc(const HashTable *ht, zend_string *key);
927 static zend_always_inline void *zend_hash_index_find_ptr(const HashTable *ht, zend_ulong h) in END_EXTERN_C()
931 zv = zend_hash_index_find(ht, h); in END_EXTERN_C()
940 static zend_always_inline zval *zend_hash_index_find_deref(HashTable *ht, zend_ulong h) in zend_hash_index_find_deref() argument
942 zval *zv = zend_hash_index_find(ht, h); in zend_hash_index_find_deref()
949 static zend_always_inline zval *zend_hash_find_deref(HashTable *ht, zend_string *str) in zend_hash_find_deref() argument
951 zval *zv = zend_hash_find(ht, str); in zend_hash_find_deref()
958 static zend_always_inline zval *zend_hash_str_find_deref(HashTable *ht, const char *str, size_t len) in zend_hash_str_find_deref() argument
960 zval *zv = zend_hash_str_find(ht, str, len); in zend_hash_str_find_deref()
967 static zend_always_inline void *zend_symtable_str_find_ptr(HashTable *ht, const char *str, size_t l… in zend_symtable_str_find_ptr() argument
972 return zend_hash_index_find_ptr(ht, idx); in zend_symtable_str_find_ptr()
974 return zend_hash_str_find_ptr(ht, str, len); in zend_symtable_str_find_ptr()
978 static zend_always_inline void *zend_hash_get_current_data_ptr_ex(HashTable *ht, HashPosition *pos) in zend_hash_get_current_data_ptr_ex() argument
982 zv = zend_hash_get_current_data_ex(ht, pos); in zend_hash_get_current_data_ptr_ex()
991 #define zend_hash_get_current_data_ptr(ht) \ argument
992 zend_hash_get_current_data_ptr_ex(ht, &(ht)->nInternalPointer)
1094 #define ZEND_HASH_FOREACH_BUCKET(ht, _bucket) \ argument
1095 ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket)
1097 #define ZEND_HASH_FOREACH_BUCKET_FROM(ht, _bucket, _from) \ argument
1098 ZEND_HASH_MAP_FOREACH_BUCKET_FROM(ht, _bucket, _from)
1100 #define ZEND_HASH_REVERSE_FOREACH_BUCKET(ht, _bucket) \ argument
1101 ZEND_HASH_MAP_REVERSE_FOREACH_BUCKET(ht, _bucket)
1103 #define ZEND_HASH_FOREACH_VAL(ht, _val) \ argument
1104 _ZEND_HASH_FOREACH_VAL(ht); \
1107 #define ZEND_HASH_REVERSE_FOREACH_VAL(ht, _val) \ argument
1108 _ZEND_HASH_REVERSE_FOREACH_VAL(ht); \
1111 #define ZEND_HASH_FOREACH_VAL_IND(ht, _val) \ argument
1112 ZEND_HASH_FOREACH(ht, 1); \
1115 #define ZEND_HASH_REVERSE_FOREACH_VAL_IND(ht, _val) \ argument
1116 ZEND_HASH_REVERSE_FOREACH(ht, 1); \
1119 #define ZEND_HASH_FOREACH_PTR(ht, _ptr) \ argument
1120 _ZEND_HASH_FOREACH_VAL(ht); \
1123 #define ZEND_HASH_FOREACH_PTR_FROM(ht, _ptr, _from) \ argument
1124 ZEND_HASH_FOREACH_FROM(ht, 0, _from); \
1127 #define ZEND_HASH_REVERSE_FOREACH_PTR(ht, _ptr) \ argument
1128 _ZEND_HASH_REVERSE_FOREACH_VAL(ht); \
1131 #define ZEND_HASH_FOREACH_NUM_KEY(ht, _h) \ argument
1132 ZEND_HASH_FOREACH(ht, 0); \
1135 #define ZEND_HASH_REVERSE_FOREACH_NUM_KEY(ht, _h) \ argument
1136 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1139 #define ZEND_HASH_FOREACH_STR_KEY(ht, _key) \ argument
1140 ZEND_HASH_FOREACH(ht, 0); \
1143 #define ZEND_HASH_REVERSE_FOREACH_STR_KEY(ht, _key) \ argument
1144 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1147 #define ZEND_HASH_FOREACH_KEY(ht, _h, _key) \ argument
1148 ZEND_HASH_FOREACH(ht, 0); \
1152 #define ZEND_HASH_REVERSE_FOREACH_KEY(ht, _h, _key) \ argument
1153 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1157 #define ZEND_HASH_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ argument
1158 ZEND_HASH_FOREACH(ht, 0); \
1162 #define ZEND_HASH_REVERSE_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ argument
1163 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1167 #define ZEND_HASH_FOREACH_STR_KEY_VAL(ht, _key, _val) \ argument
1168 ZEND_HASH_FOREACH(ht, 0); \
1172 #define ZEND_HASH_FOREACH_STR_KEY_VAL_FROM(ht, _key, _val, _from) \ argument
1173 ZEND_HASH_FOREACH_FROM(ht, 0, _from); \
1177 #define ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL(ht, _key, _val) \ argument
1178 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1182 #define ZEND_HASH_FOREACH_KEY_VAL(ht, _h, _key, _val) \ argument
1183 ZEND_HASH_FOREACH(ht, 0); \
1188 #define ZEND_HASH_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val) \ argument
1189 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1194 #define ZEND_HASH_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ argument
1195 ZEND_HASH_FOREACH(ht, 1); \
1199 #define ZEND_HASH_REVERSE_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ argument
1200 ZEND_HASH_REVERSE_FOREACH(ht, 1); \
1204 #define ZEND_HASH_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ argument
1205 ZEND_HASH_FOREACH(ht, 1); \
1210 #define ZEND_HASH_REVERSE_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ argument
1211 ZEND_HASH_REVERSE_FOREACH(ht, 1); \
1216 #define ZEND_HASH_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ argument
1217 ZEND_HASH_FOREACH(ht, 0); \
1221 #define ZEND_HASH_REVERSE_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ argument
1222 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1226 #define ZEND_HASH_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ argument
1227 ZEND_HASH_FOREACH(ht, 0); \
1231 #define ZEND_HASH_REVERSE_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ argument
1232 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1236 #define ZEND_HASH_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ argument
1237 ZEND_HASH_FOREACH(ht, 0); \
1242 #define ZEND_HASH_REVERSE_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ argument
1243 ZEND_HASH_REVERSE_FOREACH(ht, 0); \
1299 #define ZEND_HASH_MAP_FOREACH_BUCKET(ht, _bucket) \ argument
1300 ZEND_HASH_MAP_FOREACH(ht, 0); \
1303 #define ZEND_HASH_MAP_FOREACH_BUCKET_FROM(ht, _bucket, _from) \ argument
1304 ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \
1307 #define ZEND_HASH_MAP_REVERSE_FOREACH_BUCKET(ht, _bucket) \ argument
1308 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1311 #define ZEND_HASH_MAP_FOREACH_VAL(ht, _val) \ argument
1312 ZEND_HASH_MAP_FOREACH(ht, 0); \
1315 #define ZEND_HASH_MAP_REVERSE_FOREACH_VAL(ht, _val) \ argument
1316 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1319 #define ZEND_HASH_MAP_FOREACH_VAL_IND(ht, _val) \ argument
1320 ZEND_HASH_MAP_FOREACH(ht, 1); \
1323 #define ZEND_HASH_MAP_REVERSE_FOREACH_VAL_IND(ht, _val) \ argument
1324 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \
1327 #define ZEND_HASH_MAP_FOREACH_PTR(ht, _ptr) \ argument
1328 ZEND_HASH_MAP_FOREACH(ht, 0); \
1331 #define ZEND_HASH_MAP_FOREACH_PTR_FROM(ht, _ptr, _from) \ argument
1332 ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \
1335 #define ZEND_HASH_MAP_REVERSE_FOREACH_PTR(ht, _ptr) \ argument
1336 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1339 #define ZEND_HASH_MAP_FOREACH_NUM_KEY(ht, _h) \ argument
1340 ZEND_HASH_MAP_FOREACH(ht, 0); \
1343 #define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY(ht, _h) \ argument
1344 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1347 #define ZEND_HASH_MAP_FOREACH_STR_KEY(ht, _key) \ argument
1348 ZEND_HASH_MAP_FOREACH(ht, 0); \
1351 #define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY(ht, _key) \ argument
1352 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1355 #define ZEND_HASH_MAP_FOREACH_KEY(ht, _h, _key) \ argument
1356 ZEND_HASH_MAP_FOREACH(ht, 0); \
1360 #define ZEND_HASH_MAP_REVERSE_FOREACH_KEY(ht, _h, _key) \ argument
1361 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1365 #define ZEND_HASH_MAP_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ argument
1366 ZEND_HASH_MAP_FOREACH(ht, 0); \
1370 #define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY_VAL(ht, _h, _val) \ argument
1371 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1375 #define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL(ht, _key, _val) \ argument
1376 ZEND_HASH_MAP_FOREACH(ht, 0); \
1380 #define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_FROM(ht, _key, _val, _from) \ argument
1381 ZEND_HASH_MAP_FOREACH_FROM(ht, 0, _from); \
1385 #define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL(ht, _key, _val) \ argument
1386 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1390 #define ZEND_HASH_MAP_FOREACH_KEY_VAL(ht, _h, _key, _val) \ argument
1391 ZEND_HASH_MAP_FOREACH(ht, 0); \
1396 #define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_VAL(ht, _h, _key, _val) \ argument
1397 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1402 #define ZEND_HASH_MAP_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ argument
1403 ZEND_HASH_MAP_FOREACH(ht, 1); \
1407 #define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_VAL_IND(ht, _key, _val) \ argument
1408 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \
1412 #define ZEND_HASH_MAP_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ argument
1413 ZEND_HASH_MAP_FOREACH(ht, 1); \
1418 #define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_VAL_IND(ht, _h, _key, _val) \ argument
1419 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 1); \
1424 #define ZEND_HASH_MAP_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ argument
1425 ZEND_HASH_MAP_FOREACH(ht, 0); \
1429 #define ZEND_HASH_MAP_REVERSE_FOREACH_NUM_KEY_PTR(ht, _h, _ptr) \ argument
1430 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1434 #define ZEND_HASH_MAP_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ argument
1435 ZEND_HASH_MAP_FOREACH(ht, 0); \
1439 #define ZEND_HASH_MAP_REVERSE_FOREACH_STR_KEY_PTR(ht, _key, _ptr) \ argument
1440 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1444 #define ZEND_HASH_MAP_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ argument
1445 ZEND_HASH_MAP_FOREACH(ht, 0); \
1450 #define ZEND_HASH_MAP_REVERSE_FOREACH_KEY_PTR(ht, _h, _key, _ptr) \ argument
1451 ZEND_HASH_MAP_REVERSE_FOREACH(ht, 0); \
1480 #define ZEND_HASH_PACKED_FOREACH_VAL(ht, _val) \ argument
1481 ZEND_HASH_PACKED_FOREACH(ht); \
1484 #define ZEND_HASH_PACKED_REVERSE_FOREACH_VAL(ht, _val) \ argument
1485 ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \
1488 #define ZEND_HASH_PACKED_FOREACH_PTR(ht, _ptr) \ argument
1489 ZEND_HASH_PACKED_FOREACH(ht); \
1492 #define ZEND_HASH_PACKED_REVERSE_FOREACH_PTR(ht, _ptr) \ argument
1493 ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \
1496 #define ZEND_HASH_PACKED_FOREACH_KEY(ht, _h) \ argument
1497 ZEND_HASH_PACKED_FOREACH(ht); \
1500 #define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY(ht, _h) \ argument
1501 ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \
1504 #define ZEND_HASH_PACKED_FOREACH_KEY_VAL(ht, _h, _val) \ argument
1505 ZEND_HASH_PACKED_FOREACH(ht); \
1509 #define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY_VAL(ht, _h, _val) \ argument
1510 ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \
1514 #define ZEND_HASH_PACKED_FOREACH_KEY_PTR(ht, _h, _ptr) \ argument
1515 ZEND_HASH_PACKED_FOREACH(ht); \
1519 #define ZEND_HASH_PACKED_REVERSE_FOREACH_KEY_PTR(ht, _h, _ptr) \ argument
1520 ZEND_HASH_PACKED_REVERSE_FOREACH(ht); \
1529 #define ZEND_HASH_FILL_PACKED(ht) do { \ argument
1530 HashTable *__fill_ht = (ht); \
1622 static zend_always_inline zval *_zend_hash_append_ex(HashTable *ht, zend_string *key, zval *zv, boo… in _zend_hash_append_ex() argument
1624 uint32_t idx = ht->nNumUsed++; in _zend_hash_append_ex()
1626 Bucket *p = ht->arData + idx; in _zend_hash_append_ex()
1630 HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; in _zend_hash_append_ex()
1636 nIndex = (uint32_t)p->h | ht->nTableMask; in _zend_hash_append_ex()
1637 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_append_ex()
1638 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_append_ex()
1639 ht->nNumOfElements++; in _zend_hash_append_ex()
1643 static zend_always_inline zval *_zend_hash_append(HashTable *ht, zend_string *key, zval *zv) in _zend_hash_append() argument
1645 return _zend_hash_append_ex(ht, key, zv, 0); in _zend_hash_append()
1648 static zend_always_inline zval *_zend_hash_append_ptr_ex(HashTable *ht, zend_string *key, void *ptr… in _zend_hash_append_ptr_ex() argument
1650 uint32_t idx = ht->nNumUsed++; in _zend_hash_append_ptr_ex()
1652 Bucket *p = ht->arData + idx; in _zend_hash_append_ptr_ex()
1656 HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; in _zend_hash_append_ptr_ex()
1662 nIndex = (uint32_t)p->h | ht->nTableMask; in _zend_hash_append_ptr_ex()
1663 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_append_ptr_ex()
1664 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_append_ptr_ex()
1665 ht->nNumOfElements++; in _zend_hash_append_ptr_ex()
1669 static zend_always_inline zval *_zend_hash_append_ptr(HashTable *ht, zend_string *key, void *ptr) in _zend_hash_append_ptr() argument
1671 return _zend_hash_append_ptr_ex(ht, key, ptr, 0); in _zend_hash_append_ptr()
1674 static zend_always_inline void _zend_hash_append_ind(HashTable *ht, zend_string *key, zval *ptr) in _zend_hash_append_ind() argument
1676 uint32_t idx = ht->nNumUsed++; in _zend_hash_append_ind()
1678 Bucket *p = ht->arData + idx; in _zend_hash_append_ind()
1682 HT_FLAGS(ht) &= ~HASH_FLAG_STATIC_KEYS; in _zend_hash_append_ind()
1688 nIndex = (uint32_t)p->h | ht->nTableMask; in _zend_hash_append_ind()
1689 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_append_ind()
1690 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_append_ind()
1691 ht->nNumOfElements++; in _zend_hash_append_ind()