Lines Matching refs:idx

334 	uint32_t idx;  in zend_hash_iterator_add()  local
343 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
344 if (idx + 1 > EG(ht_iterators_used)) { in zend_hash_iterator_add()
345 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
347 return idx; in zend_hash_iterator_add()
362 idx = iter - EG(ht_iterators); in zend_hash_iterator_add()
363 EG(ht_iterators_used) = idx + 1; in zend_hash_iterator_add()
364 return idx; in zend_hash_iterator_add()
367 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos(uint32_t idx, HashTable *ht) in zend_hash_iterator_pos() argument
369 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos()
371 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos()
388 ZEND_API HashPosition ZEND_FASTCALL zend_hash_iterator_pos_ex(uint32_t idx, zval *array) in zend_hash_iterator_pos_ex() argument
391 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_pos_ex()
393 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_pos_ex()
412 ZEND_API void ZEND_FASTCALL zend_hash_iterator_del(uint32_t idx) in zend_hash_iterator_del() argument
414 HashTableIterator *iter = EG(ht_iterators) + idx; in zend_hash_iterator_del()
416 ZEND_ASSERT(idx != (uint32_t)-1); in zend_hash_iterator_del()
424 if (idx == EG(ht_iterators_used) - 1) { in zend_hash_iterator_del()
425 while (idx > 0 && EG(ht_iterators)[idx - 1].ht == NULL) { in zend_hash_iterator_del()
426 idx--; in zend_hash_iterator_del()
428 EG(ht_iterators_used) = idx; in zend_hash_iterator_del()
486 uint32_t idx; in zend_hash_find_bucket() local
492 idx = HT_HASH_EX(arData, nIndex); in zend_hash_find_bucket()
493 while (EXPECTED(idx != HT_INVALID_IDX)) { in zend_hash_find_bucket()
494 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
503 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
511 uint32_t idx; in zend_hash_str_find_bucket() local
516 idx = HT_HASH_EX(arData, nIndex); in zend_hash_str_find_bucket()
517 while (idx != HT_INVALID_IDX) { in zend_hash_str_find_bucket()
518 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_str_find_bucket()
519 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
526 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
534 uint32_t idx; in zend_hash_index_find_bucket() local
539 idx = HT_HASH_EX(arData, nIndex); in zend_hash_index_find_bucket()
540 while (idx != HT_INVALID_IDX) { in zend_hash_index_find_bucket()
541 ZEND_ASSERT(idx < HT_IDX_TO_HASH(ht->nTableSize)); in zend_hash_index_find_bucket()
542 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
546 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
555 uint32_t idx; in _zend_hash_add_or_update_i() local
607 idx = ht->nNumUsed++; in _zend_hash_add_or_update_i()
610 ht->nInternalPointer = idx; in _zend_hash_add_or_update_i()
612 zend_hash_iterators_update(ht, HT_INVALID_IDX, idx); in _zend_hash_add_or_update_i()
613 p = ht->arData + idx; in _zend_hash_add_or_update_i()
624 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_add_or_update_i()
722 uint32_t idx; in _zend_hash_index_add_or_update_i() local
820 idx = ht->nNumUsed++; in _zend_hash_index_add_or_update_i()
823 ht->nInternalPointer = idx; in _zend_hash_index_add_or_update_i()
825 zend_hash_iterators_update(ht, HT_INVALID_IDX, idx); in _zend_hash_index_add_or_update_i()
829 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
835 HT_HASH(ht, nIndex) = HT_IDX_TO_HASH(idx); in _zend_hash_index_add_or_update_i()
984 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
994 if (HT_IDX_TO_HASH(ht->nNumUsed - 1) == idx) { in _zend_hash_del_el_ex()
1000 if (HT_IDX_TO_HASH(ht->nInternalPointer) == idx || UNEXPECTED(ht->u.v.nIteratorsCount)) { in _zend_hash_del_el_ex()
1003 new_idx = idx = HT_HASH_TO_IDX(idx); in _zend_hash_del_el_ex()
1013 if (ht->nInternalPointer == idx) { in _zend_hash_del_el_ex()
1016 zend_hash_iterators_update(ht, idx, new_idx); in _zend_hash_del_el_ex()
1032 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1040 if (i != idx) { in _zend_hash_del_el()
1042 while (Z_NEXT(prev->val) != idx) { in _zend_hash_del_el()
1049 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1063 uint32_t idx; in zend_hash_del() local
1073 idx = HT_HASH(ht, nIndex); in zend_hash_del()
1074 while (idx != HT_INVALID_IDX) { in zend_hash_del()
1075 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1081 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1085 idx = Z_NEXT(p->val); in zend_hash_del()
1094 uint32_t idx; in zend_hash_del_ind() local
1104 idx = HT_HASH(ht, nIndex); in zend_hash_del_ind()
1105 while (idx != HT_INVALID_IDX) { in zend_hash_del_ind()
1106 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1129 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1134 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1143 uint32_t idx; in zend_hash_str_del_ind() local
1153 idx = HT_HASH(ht, nIndex); in zend_hash_str_del_ind()
1154 while (idx != HT_INVALID_IDX) { in zend_hash_str_del_ind()
1155 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1173 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1178 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1187 uint32_t idx; in zend_hash_str_del() local
1197 idx = HT_HASH(ht, nIndex); in zend_hash_str_del()
1198 while (idx != HT_INVALID_IDX) { in zend_hash_str_del()
1199 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1204 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1208 idx = Z_NEXT(p->val); in zend_hash_str_del()
1216 uint32_t idx; in zend_hash_index_del() local
1235 idx = HT_HASH(ht, nIndex); in zend_hash_index_del()
1236 while (idx != HT_INVALID_IDX) { in zend_hash_index_del()
1237 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1239 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1243 idx = Z_NEXT(p->val); in zend_hash_index_del()
1473 uint32_t idx; in zend_hash_graceful_destroy() local
1480 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1482 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1493 uint32_t idx; in zend_hash_graceful_reverse_destroy() local
1499 idx = ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1501 while (idx > 0) { in zend_hash_graceful_reverse_destroy()
1502 idx--; in zend_hash_graceful_reverse_destroy()
1505 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1526 uint32_t idx; in zend_hash_apply() local
1534 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply()
1535 p = ht->arData + idx; in zend_hash_apply()
1540 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
1552 uint32_t idx; in zend_hash_apply_with_argument() local
1560 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_argument()
1561 p = ht->arData + idx; in zend_hash_apply_with_argument()
1566 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
1578 uint32_t idx; in zend_hash_apply_with_arguments() local
1589 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_apply_with_arguments()
1590 p = ht->arData + idx; in zend_hash_apply_with_arguments()
1599 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
1614 uint32_t idx; in zend_hash_reverse_apply() local
1622 idx = ht->nNumUsed; in zend_hash_reverse_apply()
1623 while (idx > 0) { in zend_hash_reverse_apply()
1624 idx--; in zend_hash_reverse_apply()
1625 p = ht->arData + idx; in zend_hash_reverse_apply()
1631 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
1643 uint32_t idx; in zend_hash_copy() local
1653 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_copy()
1654 p = source->arData + idx; in zend_hash_copy()
1657 if (setTargetPointer && source->nInternalPointer == idx) { in zend_hash_copy()
1678 idx = 0; in zend_hash_copy()
1679 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_hash_copy()
1680 idx++; in zend_hash_copy()
1682 target->nInternalPointer = idx; in zend_hash_copy()
1687 … int zend_array_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket … in zend_array_dup_element() argument
1736 HT_HASH(target, nIndex) = HT_IDX_TO_HASH(idx); in zend_array_dup_element()
1759 uint32_t idx = 0; in zend_array_dup_elements() local
1765 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
1766 uint32_t target_idx = idx; in zend_array_dup_elements()
1768 idx++; p++; in zend_array_dup_elements()
1771 if (source->nInternalPointer == idx) { in zend_array_dup_elements()
1776 idx++; p++; in zend_array_dup_elements()
1780 idx++; p++; q++; in zend_array_dup_elements()
1782 return idx; in zend_array_dup_elements()
1787 uint32_t idx; in zend_array_dup() local
1818 idx = 0; in zend_array_dup()
1819 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_array_dup()
1820 idx++; in zend_array_dup()
1822 target->nInternalPointer = idx; in zend_array_dup()
1841 idx = 0; in zend_array_dup()
1842 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_array_dup()
1843 idx++; in zend_array_dup()
1845 target->nInternalPointer = idx; in zend_array_dup()
1858 idx = zend_array_dup_elements(source, target, 1, 0); in zend_array_dup()
1860 idx = zend_array_dup_elements(source, target, 1, 1); in zend_array_dup()
1864 idx = zend_array_dup_elements(source, target, 0, 0); in zend_array_dup()
1866 idx = zend_array_dup_elements(source, target, 0, 1); in zend_array_dup()
1869 target->nNumUsed = idx; in zend_array_dup()
1870 target->nNumOfElements = idx; in zend_array_dup()
1871 if (idx > 0 && target->nInternalPointer == HT_INVALID_IDX) { in zend_array_dup()
1881 uint32_t idx; in _zend_hash_merge() local
1890 for (idx = 0; idx < source->nNumUsed; idx++) { in _zend_hash_merge()
1891 p = source->arData + idx; in _zend_hash_merge()
1910 for (idx = 0; idx < source->nNumUsed; idx++) { in _zend_hash_merge()
1911 p = source->arData + idx; in _zend_hash_merge()
1931 idx = 0; in _zend_hash_merge()
1932 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in _zend_hash_merge()
1933 idx++; in _zend_hash_merge()
1935 target->nInternalPointer = idx; in _zend_hash_merge()
1952 uint32_t idx; in zend_hash_merge_ex() local
1960 for (idx = 0; idx < source->nNumUsed; idx++) { in zend_hash_merge_ex()
1961 p = source->arData + idx; in zend_hash_merge_ex()
1971 idx = 0; in zend_hash_merge_ex()
1972 while (Z_TYPE(target->arData[idx].val) == IS_UNDEF) { in zend_hash_merge_ex()
1973 idx++; in zend_hash_merge_ex()
1975 target->nInternalPointer = idx; in zend_hash_merge_ex()
2068 uint32_t idx; in zend_hash_internal_pointer_reset_ex() local
2073 for (idx = 0; idx < ht->nNumUsed; idx++) { in zend_hash_internal_pointer_reset_ex()
2074 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_reset_ex()
2075 *pos = idx; in zend_hash_internal_pointer_reset_ex()
2088 uint32_t idx; in zend_hash_internal_pointer_end_ex() local
2093 idx = ht->nNumUsed; in zend_hash_internal_pointer_end_ex()
2094 while (idx > 0) { in zend_hash_internal_pointer_end_ex()
2095 idx--; in zend_hash_internal_pointer_end_ex()
2096 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_internal_pointer_end_ex()
2097 *pos = idx; in zend_hash_internal_pointer_end_ex()
2107 uint32_t idx = *pos; in zend_hash_move_forward_ex() local
2112 if (idx != HT_INVALID_IDX) { in zend_hash_move_forward_ex()
2114 idx++; in zend_hash_move_forward_ex()
2115 if (idx >= ht->nNumUsed) { in zend_hash_move_forward_ex()
2119 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_forward_ex()
2120 *pos = idx; in zend_hash_move_forward_ex()
2131 uint32_t idx = *pos; in zend_hash_move_backwards_ex() local
2136 if (idx != HT_INVALID_IDX) { in zend_hash_move_backwards_ex()
2137 while (idx > 0) { in zend_hash_move_backwards_ex()
2138 idx--; in zend_hash_move_backwards_ex()
2139 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) { in zend_hash_move_backwards_ex()
2140 *pos = idx; in zend_hash_move_backwards_ex()
2155 uint32_t idx = *pos; in zend_hash_get_current_key_ex() local
2159 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_key_ex()
2160 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2174 uint32_t idx = *pos; in zend_hash_get_current_key_zval_ex() local
2178 if (idx == HT_INVALID_IDX) { in zend_hash_get_current_key_zval_ex()
2181 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2192 uint32_t idx = *pos; in zend_hash_get_current_key_type_ex() local
2196 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_key_type_ex()
2197 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2210 uint32_t idx = *pos; in zend_hash_get_current_data_ex() local
2214 if (idx != HT_INVALID_IDX) { in zend_hash_get_current_data_ex()
2215 p = ht->arData + idx; in zend_hash_get_current_data_ex()
2432 uint32_t idx; in zend_hash_minmax() local
2441 idx = 0; in zend_hash_minmax()
2443 if (idx == ht->nNumUsed) { in zend_hash_minmax()
2446 if (Z_TYPE(ht->arData[idx].val) != IS_UNDEF) break; in zend_hash_minmax()
2447 idx++; in zend_hash_minmax()
2449 res = ht->arData + idx; in zend_hash_minmax()
2450 for (; idx < ht->nNumUsed; idx++) { in zend_hash_minmax()
2451 p = ht->arData + idx; in zend_hash_minmax()
2467 …_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
2484 *idx = (*tmp - '0'); in _zend_handle_numeric_str_ex()
2489 if (*idx-1 > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
2492 *idx = 0 - *idx; in _zend_handle_numeric_str_ex()
2493 } else if (*idx > ZEND_LONG_MAX) { /* overflow */ in _zend_handle_numeric_str_ex()
2499 *idx = (*idx * 10) + (*tmp - '0'); in _zend_handle_numeric_str_ex()