Lines Matching refs:idx
322 uint32_t idx; in zend_hash_iterator_add() local
331 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
332 if (idx + 1 > EG(ht_iterators_used)) { in zend_hash_iterator_add()
333 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
335 return idx; in zend_hash_iterator_add()
350 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
351 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
352 return idx; in zend_hash_iterator_add()
355 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht) in zend_hash_iterator_pos() argument
357 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos()
359 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos()
376 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array) in zend_hash_iterator_pos_ex() argument
379 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos_ex()
381 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos_ex()
400 ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx) in zend_hash_iterator_del() argument
402 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_del()
404 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_del()
412 if (idx == EG(ht_iterators_used) - 1) { in zend_hash_iterator_del()
413 while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) { in zend_hash_iterator_del()
414 idx--; in zend_hash_iterator_del()
416 EG(ht_iterators_used) = idx; in zend_hash_iterator_del()
474 uint32_t idx; in zend_hash_find_bucket() local
480 idx = HT_HASH_EX(arData, nIndex); in zend_hash_find_bucket()
481 while (EXPECTED(idx != HT_INVALID_IDX)) { in zend_hash_find_bucket()
482 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
491 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
499 uint32_t idx; in zend_hash_str_find_bucket() local
504 idx = HT_HASH_EX(arData, nIndex); in zend_hash_str_find_bucket()
505 while (idx != HT_INVALID_IDX) { in zend_hash_str_find_bucket()
506 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_str_find_bucket()
507 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
514 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
522 uint32_t idx; in zend_hash_index_find_bucket() local
527 idx = HT_HASH_EX(arData, nIndex); in zend_hash_index_find_bucket()
528 while (idx != HT_INVALID_IDX) { in zend_hash_index_find_bucket()
529 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_index_find_bucket()
530 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
534 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
543 uint32_t idx; in _zend_hash_add_or_update_i() local
592 idx = ht->nNumUsed++; in _zend_hash_add_or_update_i()
595 ht->nInternalPointer = idx; in _zend_hash_add_or_update_i()
597 zend_hash_iterators_update(ht, HT_INVALID_IDX, idx); in _zend_hash_add_or_update_i()
598 p = ht->arData + idx; in _zend_hash_add_or_update_i()
609 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_add_or_update_i()
706 uint32_t idx; in _zend_hash_index_add_or_update_i() local
798 idx = ht->nNumUsed++; in _zend_hash_index_add_or_update_i()
801 ht->nInternalPointer = idx; in _zend_hash_index_add_or_update_i()
803 zend_hash_iterators_update(ht, HT_INVALID_IDX, idx); in _zend_hash_index_add_or_update_i()
807 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
813 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_index_add_or_update_i()
957 static zend_always_inline void _zend_hash_del_el_ex(HashTable *ht, uint32_t idx, Bucket *p, Bucket … in _zend_hash_del_el_ex() argument
966 if (HT_IDX_TO_HASH(ht->nNumUsed - 1) == idx) { in _zend_hash_del_el_ex()
972 if (HT_IDX_TO_HASH(ht->nInternalPointer) == idx || UNEXPECTED(ht->u.v.nIteratorsCount)) { in _zend_hash_del_el_ex()
975 new_idx = idx = HT_HASH_TO_IDX(idx); in _zend_hash_del_el_ex()
985 if (ht->nInternalPointer == idx) { in _zend_hash_del_el_ex()
988 zend_hash_iterators_update(ht, idx, new_idx); in _zend_hash_del_el_ex()
1003 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1011 if (i != idx) { in _zend_hash_del_el()
1013 while (Z_NEXT(prev->val) != idx) { in _zend_hash_del_el()
1020 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1034 uint32_t idx; in zend_hash_del() local
1044 idx = HT_HASH(ht, nIndex); in zend_hash_del()
1045 while (idx != HT_INVALID_IDX) { in zend_hash_del()
1046 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1052 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1056 idx = Z_NEXT(p->val); in zend_hash_del()
1065 uint32_t idx; in zend_hash_del_ind() local
1075 idx = HT_HASH(ht, nIndex); in zend_hash_del_ind()
1076 while (idx != HT_INVALID_IDX) { in zend_hash_del_ind()
1077 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1100 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1105 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1114 uint32_t idx; in zend_hash_str_del_ind() local
1124 idx = HT_HASH(ht, nIndex); in zend_hash_str_del_ind()
1125 while (idx != HT_INVALID_IDX) { in zend_hash_str_del_ind()
1126 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1144 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1149 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1158 uint32_t idx; in zend_hash_str_del() local
1168 idx = HT_HASH(ht, nIndex); in zend_hash_str_del()
1169 while (idx != HT_INVALID_IDX) { in zend_hash_str_del()
1170 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1175 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1179 idx = Z_NEXT(p->val); in zend_hash_str_del()
1187 uint32_t idx; in zend_hash_index_del() local
1206 idx = HT_HASH(ht, nIndex); in zend_hash_index_del()
1207 while (idx != HT_INVALID_IDX) { in zend_hash_index_del()
1208 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1210 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1214 idx = Z_NEXT(p->val); in zend_hash_index_del()
1444 uint32_t idx; in zend_hash_graceful_destroy() local
1451 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1453 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1464 uint32_t idx; in zend_hash_graceful_reverse_destroy() local
1470 idx = ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1472 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
1473 idx--; in zend_hash_graceful_reverse_destroy()
1476 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1497 uint32_t idx; in zend_hash_apply() local
1504 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
1505 p = ht->arData + idx; in zend_hash_apply()
1511 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
1523 uint32_t idx; in zend_hash_apply_with_argument() local
1530 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
1531 p = ht->arData + idx; in zend_hash_apply_with_argument()
1537 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
1549 uint32_t idx; in zend_hash_apply_with_arguments() local
1559 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
1560 p = ht->arData + idx; in zend_hash_apply_with_arguments()
1570 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
1585 uint32_t idx; in zend_hash_reverse_apply() local
1592 idx = ht->nNumUsed; in zend_hash_reverse_apply()
1593 while (idx > 0) { in zend_hash_reverse_apply()
1594 idx--; in zend_hash_reverse_apply()
1595 p = ht->arData + idx; in zend_hash_reverse_apply()
1602 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
1614 uint32_t idx; in zend_hash_copy() local
1624 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
1625 p = source->arData + idx; in zend_hash_copy()
1628 if (setTargetPointer && source->nInternalPointer == idx) { in zend_hash_copy()
1649 idx = 0; in zend_hash_copy()
1650 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_hash_copy()
1651 idx++; in zend_hash_copy()
1653 target->nInternalPointer = idx; in zend_hash_copy()
1658 … int zend_array_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket … in zend_array_dup_element() argument
1707 HT_HASH(target, nIndex) = HT_IDX_TO_HASH(idx); in zend_array_dup_element()
1730 uint32_t idx = 0; in zend_array_dup_elements() local
1736 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
1737 uint32_t target_idx = idx; in zend_array_dup_elements()
1739 idx++; p++; in zend_array_dup_elements()
1742 if (source->nInternalPointer == idx) { in zend_array_dup_elements()
1747 idx++; p++; in zend_array_dup_elements()
1751 idx++; p++; q++; in zend_array_dup_elements()
1753 return idx; in zend_array_dup_elements()
1758 uint32_t idx; in zend_array_dup() local
1789 idx = 0; in zend_array_dup()
1790 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_array_dup()
1791 idx++; in zend_array_dup()
1793 target->nInternalPointer = idx; in zend_array_dup()
1812 idx = 0; in zend_array_dup()
1813 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_array_dup()
1814 idx++; in zend_array_dup()
1816 target->nInternalPointer = idx; in zend_array_dup()
1829 idx = zend_array_dup_elements(source, target, 1, 0); in zend_array_dup()
1831 idx = zend_array_dup_elements(source, target, 1, 1); in zend_array_dup()
1835 idx = zend_array_dup_elements(source, target, 0, 0); in zend_array_dup()
1837 idx = zend_array_dup_elements(source, target, 0, 1); in zend_array_dup()
1840 target->nNumUsed = idx; in zend_array_dup()
1841 target->nNumOfElements = idx; in zend_array_dup()
1842 if (idx > 0 && target->nInternalPointer == HT_INVALID_IDX) { in zend_array_dup()
1852 uint32_t idx; in _zend_hash_merge() local
1861 for (idx = 0; idx < source->nNumUsed; idx++) { in _zend_hash_merge()
1862 p = source->arData + idx; in _zend_hash_merge()
1881 for (idx = 0; idx < source->nNumUsed; idx++) { in _zend_hash_merge()
1882 p = source->arData + idx; in _zend_hash_merge()
1902 idx = 0; in _zend_hash_merge()
1903 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in _zend_hash_merge()
1904 idx++; in _zend_hash_merge()
1906 target->nInternalPointer = idx; in _zend_hash_merge()
1923 uint32_t idx; in zend_hash_merge_ex() local
1931 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge_ex()
1932 p = source->arData + idx; in zend_hash_merge_ex()
1942 idx = 0; in zend_hash_merge_ex()
1943 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_hash_merge_ex()
1944 idx++; in zend_hash_merge_ex()
1946 target->nInternalPointer = idx; in zend_hash_merge_ex()
2048 uint32_t idx; in zend_hash_internal_pointer_reset_ex() local
2053 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_internal_pointer_reset_ex()
2054 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_reset_ex()
2055 *pos = idx; in zend_hash_internal_pointer_reset_ex()
2068 uint32_t idx; in zend_hash_internal_pointer_end_ex() local
2073 idx = ht->nNumUsed; in zend_hash_internal_pointer_end_ex()
2074 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2075 idx--; in zend_hash_internal_pointer_end_ex()
2076 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2077 *pos = idx; in zend_hash_internal_pointer_end_ex()
2087 uint32_t idx = *pos; in zend_hash_move_forward_ex() local
2092 if (idx != HT_INVALID_IDX) { in zend_hash_move_forward_ex()
2094 idx++; in zend_hash_move_forward_ex()
2095 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2099 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_forward_ex()
2100 *pos = idx; in zend_hash_move_forward_ex()
2111 uint32_t idx = *pos; in zend_hash_move_backwards_ex() local
2116 if (idx != HT_INVALID_IDX) { in zend_hash_move_backwards_ex()
2117 while (idx > 0) { in zend_hash_move_backwards_ex()
2118 idx--; in zend_hash_move_backwards_ex()
2119 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2120 *pos = idx; in zend_hash_move_backwards_ex()
2135 uint32_t idx = *pos; in zend_hash_get_current_key_ex() local
2139 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_key_ex()
2140 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2154 uint32_t idx = *pos; in zend_hash_get_current_key_zval_ex() local
2158 if (idx == HT_INVALID_IDX) { in zend_hash_get_current_key_zval_ex()
2161 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2172 uint32_t idx = *pos; in zend_hash_get_current_key_type_ex() local
2176 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_key_type_ex()
2177 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2190 uint32_t idx = *pos; in zend_hash_get_current_data_ex() local
2194 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_data_ex()
2195 p = ht->arData + idx; in zend_hash_get_current_data_ex()
2409 uint32_t idx; in zend_hash_minmax() local
2418 idx = 0; in zend_hash_minmax()
2420 if (idx == ht->nNumUsed) { in zend_hash_minmax()
2423 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) break; in zend_hash_minmax()
2424 idx++; in zend_hash_minmax()
2426 res = ht->arData + idx; in zend_hash_minmax()
2427 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
2428 p = ht->arData + idx; in zend_hash_minmax()
2444 …_API int ZEND_FASTCALL _zend_handle_numeric_str_ex(const char *key, size_t length, zend_ulong *idx) in _zend_handle_numeric_str_ex() argument
2461 *idx = (*tmp - '0'); in _zend_handle_numeric_str_ex()
2466 if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
2469 *idx = 0 - *idx; in _zend_handle_numeric_str_ex()
2470 } else if (*idx > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
2476 *idx = (*idx * 10) + (*tmp - '0'); in _zend_handle_numeric_str_ex()