Lines Matching refs:p
263 Bucket *p; in zend_new_pair() local
269 p = ht->arData; in zend_new_pair()
270 ZVAL_COPY_VALUE(&p->val, val1); in zend_new_pair()
271 p->h = 0; in zend_new_pair()
272 p->key = NULL; in zend_new_pair()
274 p++; in zend_new_pair()
275 ZVAL_COPY_VALUE(&p->val, val2); in zend_new_pair()
276 p->h = 1; in zend_new_pair()
277 p->key = NULL; in zend_new_pair()
382 Bucket *p, *end, *arData; in zend_hash_discard() local
386 p = arData + ht->nNumUsed; in zend_hash_discard()
389 while (p != end) { in zend_hash_discard()
390 p--; in zend_hash_discard()
391 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_discard()
395 if (!(Z_NEXT(p->val) == HT_INVALID_IDX || HT_HASH_TO_BUCKET_EX(arData, Z_NEXT(p->val)) < p)) { in zend_hash_discard()
399 nIndex = p->h | ht->nTableMask; in zend_hash_discard()
400 HT_HASH_EX(arData, nIndex) = Z_NEXT(p->val); in zend_hash_discard()
622 Bucket *p, *arData; in zend_hash_find_bucket() local
636 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
637 if (EXPECTED(p->key == key)) { /* check for the same interned string */ in zend_hash_find_bucket()
638 return p; in zend_hash_find_bucket()
642 if (p->h == ZSTR_H(key) && in zend_hash_find_bucket()
643 EXPECTED(p->key) && in zend_hash_find_bucket()
644 zend_string_equal_content(p->key, key)) { in zend_hash_find_bucket()
645 return p; in zend_hash_find_bucket()
647 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
651 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
652 if (p->key == key) { /* check for the same interned string */ in zend_hash_find_bucket()
653 return p; in zend_hash_find_bucket()
662 Bucket *p, *arData; in zend_hash_str_find_bucket() local
669 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
670 if ((p->h == h) in zend_hash_str_find_bucket()
671 && p->key in zend_hash_str_find_bucket()
672 && (ZSTR_LEN(p->key) == len) in zend_hash_str_find_bucket()
673 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_find_bucket()
674 return p; in zend_hash_str_find_bucket()
676 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
685 Bucket *p, *arData; in zend_hash_index_find_bucket() local
692 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
693 if (p->h == h && !p->key) { in zend_hash_index_find_bucket()
694 return p; in zend_hash_index_find_bucket()
696 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
706 Bucket *p, *arData; in _zend_hash_add_or_update_i() local
729 p = zend_hash_find_bucket(ht, key, 0); in _zend_hash_add_or_update_i()
731 if (p) { in _zend_hash_add_or_update_i()
739 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
740 data = &p->val; in _zend_hash_add_or_update_i()
750 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
751 data = &p->val; in _zend_hash_add_or_update_i()
778 p = arData + idx; in _zend_hash_add_or_update_i()
779 p->key = key; in _zend_hash_add_or_update_i()
780 p->h = h = ZSTR_H(key); in _zend_hash_add_or_update_i()
782 Z_NEXT(p->val) = HT_HASH_EX(arData, nIndex); in _zend_hash_add_or_update_i()
784 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_add_or_update_i()
786 return &p->val; in _zend_hash_add_or_update_i()
794 Bucket *p; in _zend_hash_str_add_or_update_i() local
807 p = zend_hash_str_find_bucket(ht, str, len, h); in _zend_hash_str_add_or_update_i()
809 if (p) { in _zend_hash_str_add_or_update_i()
816 ZEND_ASSERT(&p->val != pData); in _zend_hash_str_add_or_update_i()
817 data = &p->val; in _zend_hash_str_add_or_update_i()
827 ZEND_ASSERT(&p->val != pData); in _zend_hash_str_add_or_update_i()
828 data = &p->val; in _zend_hash_str_add_or_update_i()
846 p = ht->arData + idx; in _zend_hash_str_add_or_update_i()
847 p->key = key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in _zend_hash_str_add_or_update_i()
848 p->h = ZSTR_H(key) = h; in _zend_hash_str_add_or_update_i()
850 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_str_add_or_update_i()
852 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_str_add_or_update_i()
855 return &p->val; in _zend_hash_str_add_or_update_i()
962 Bucket *p; in _zend_hash_index_add_or_update_i() local
969 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
970 if (Z_TYPE(p->val) != IS_UNDEF) { in _zend_hash_index_add_or_update_i()
976 ht->pDestructor(&p->val); in _zend_hash_index_add_or_update_i()
978 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
979 return &p->val; in _zend_hash_index_add_or_update_i()
985 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
990 while (q != p) { in _zend_hash_index_add_or_update_i()
1017 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_add_or_update_i()
1018 if (p) { in _zend_hash_index_add_or_update_i()
1028 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
1029 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_index_add_or_update_i()
1036 p->h = h; in _zend_hash_index_add_or_update_i()
1037 p->key = NULL; in _zend_hash_index_add_or_update_i()
1038 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
1040 return &p->val; in _zend_hash_index_add_or_update_i()
1090 Bucket *p, *arData; in zend_hash_set_bucket_key() local
1096 p = zend_hash_find_bucket(ht, key, 0); in zend_hash_set_bucket_key()
1097 if (UNEXPECTED(p)) { in zend_hash_set_bucket_key()
1098 return (p == b) ? &p->val : NULL; in zend_hash_set_bucket_key()
1115 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1116 while (Z_NEXT(p->val) != idx) { in zend_hash_set_bucket_key()
1117 i = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1118 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1120 Z_NEXT(p->val) = Z_NEXT(b->val); in zend_hash_set_bucket_key()
1135 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1136 while (Z_NEXT(p->val) != HT_INVALID_IDX && Z_NEXT(p->val) > idx) { in zend_hash_set_bucket_key()
1137 i = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1138 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1140 Z_NEXT(b->val) = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1141 Z_NEXT(p->val) = idx; in zend_hash_set_bucket_key()
1173 Bucket *p; in zend_hash_rehash() local
1188 p = ht->arData; in zend_hash_rehash()
1191 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
1192 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
1194 p++; in zend_hash_rehash()
1199 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) { in zend_hash_rehash()
1201 Bucket *q = p; in zend_hash_rehash()
1205 p++; in zend_hash_rehash()
1206 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
1207 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
1208 q->h = p->h; in zend_hash_rehash()
1210 q->key = p->key; in zend_hash_rehash()
1224 p++; in zend_hash_rehash()
1225 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
1226 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
1227 q->h = p->h; in zend_hash_rehash()
1229 q->key = p->key; in zend_hash_rehash()
1249 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
1250 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
1252 p++; in zend_hash_rehash()
1264 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
1268 Z_NEXT(prev->val) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
1270 HT_HASH(ht, p->h | ht->nTableMask) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
1298 if (p->key) { in _zend_hash_del_el_ex()
1299 zend_string_release(p->key); in _zend_hash_del_el_ex()
1303 ZVAL_COPY_VALUE(&tmp, &p->val); in _zend_hash_del_el_ex()
1304 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1307 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1311 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1316 uint32_t nIndex = p->h | ht->nTableMask; in _zend_hash_del_el()
1328 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1331 ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p) in zend_hash_del_bucket() argument
1335 _zend_hash_del_el(ht, HT_IDX_TO_HASH(p - ht->arData), p); in zend_hash_del_bucket()
1343 Bucket *p; in zend_hash_del() local
1354 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1355 if ((p->key == key) || in zend_hash_del()
1356 (p->h == h && in zend_hash_del()
1357 p->key && in zend_hash_del()
1358 zend_string_equal_content(p->key, key))) { in zend_hash_del()
1359 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1362 prev = p; in zend_hash_del()
1363 idx = Z_NEXT(p->val); in zend_hash_del()
1373 Bucket *p; in zend_hash_del_ind() local
1384 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1385 if ((p->key == key) || in zend_hash_del_ind()
1386 (p->h == h && in zend_hash_del_ind()
1387 p->key && in zend_hash_del_ind()
1388 zend_string_equal_content(p->key, key))) { in zend_hash_del_ind()
1389 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_del_ind()
1390 zval *data = Z_INDIRECT(p->val); in zend_hash_del_ind()
1406 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1410 prev = p; in zend_hash_del_ind()
1411 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1421 Bucket *p; in zend_hash_str_del_ind() local
1432 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1433 if ((p->h == h) in zend_hash_str_del_ind()
1434 && p->key in zend_hash_str_del_ind()
1435 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del_ind()
1436 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del_ind()
1437 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_str_del_ind()
1438 zval *data = Z_INDIRECT(p->val); in zend_hash_str_del_ind()
1450 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1454 prev = p; in zend_hash_str_del_ind()
1455 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1465 Bucket *p; in zend_hash_str_del() local
1476 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1477 if ((p->h == h) in zend_hash_str_del()
1478 && p->key in zend_hash_str_del()
1479 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del()
1480 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del()
1481 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1484 prev = p; in zend_hash_str_del()
1485 idx = Z_NEXT(p->val); in zend_hash_str_del()
1494 Bucket *p; in zend_hash_index_del() local
1502 p = ht->arData + h; in zend_hash_index_del()
1503 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_del()
1504 _zend_hash_del_el_ex(ht, HT_IDX_TO_HASH(h), p, NULL); in zend_hash_index_del()
1514 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1515 if ((p->h == h) && (p->key == NULL)) { in zend_hash_index_del()
1516 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1519 prev = p; in zend_hash_index_del()
1520 idx = Z_NEXT(p->val); in zend_hash_index_del()
1527 Bucket *p, *end; in zend_hash_destroy() local
1533 p = ht->arData; in zend_hash_destroy()
1534 end = p + ht->nNumUsed; in zend_hash_destroy()
1541 ht->pDestructor(&p->val); in zend_hash_destroy()
1542 } while (++p != end); in zend_hash_destroy()
1545 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1546 ht->pDestructor(&p->val); in zend_hash_destroy()
1548 } while (++p != end); in zend_hash_destroy()
1552 ht->pDestructor(&p->val); in zend_hash_destroy()
1553 if (EXPECTED(p->key)) { in zend_hash_destroy()
1554 zend_string_release(p->key); in zend_hash_destroy()
1556 } while (++p != end); in zend_hash_destroy()
1559 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1560 ht->pDestructor(&p->val); in zend_hash_destroy()
1561 if (EXPECTED(p->key)) { in zend_hash_destroy()
1562 zend_string_release(p->key); in zend_hash_destroy()
1565 } while (++p != end); in zend_hash_destroy()
1572 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1573 if (EXPECTED(p->key)) { in zend_hash_destroy()
1574 zend_string_release(p->key); in zend_hash_destroy()
1577 } while (++p != end); in zend_hash_destroy()
1589 Bucket *p, *end; in zend_array_destroy() local
1605 p = ht->arData; in zend_array_destroy()
1606 end = p + ht->nNumUsed; in zend_array_destroy()
1611 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1612 } while (++p != end); in zend_array_destroy()
1615 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1616 if (EXPECTED(p->key)) { in zend_array_destroy()
1617 zend_string_release_ex(p->key, 0); in zend_array_destroy()
1619 } while (++p != end); in zend_array_destroy()
1622 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_array_destroy()
1623 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1624 if (EXPECTED(p->key)) { in zend_array_destroy()
1625 zend_string_release_ex(p->key, 0); in zend_array_destroy()
1628 } while (++p != end); in zend_array_destroy()
1642 Bucket *p, *end; in zend_hash_clean() local
1648 p = ht->arData; in zend_hash_clean()
1649 end = p + ht->nNumUsed; in zend_hash_clean()
1654 ht->pDestructor(&p->val); in zend_hash_clean()
1655 } while (++p != end); in zend_hash_clean()
1658 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1659 ht->pDestructor(&p->val); in zend_hash_clean()
1661 } while (++p != end); in zend_hash_clean()
1665 ht->pDestructor(&p->val); in zend_hash_clean()
1666 if (EXPECTED(p->key)) { in zend_hash_clean()
1667 zend_string_release(p->key); in zend_hash_clean()
1669 } while (++p != end); in zend_hash_clean()
1672 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1673 ht->pDestructor(&p->val); in zend_hash_clean()
1674 if (EXPECTED(p->key)) { in zend_hash_clean()
1675 zend_string_release(p->key); in zend_hash_clean()
1678 } while (++p != end); in zend_hash_clean()
1684 if (EXPECTED(p->key)) { in zend_hash_clean()
1685 zend_string_release(p->key); in zend_hash_clean()
1687 } while (++p != end); in zend_hash_clean()
1690 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1691 if (EXPECTED(p->key)) { in zend_hash_clean()
1692 zend_string_release(p->key); in zend_hash_clean()
1695 } while (++p != end); in zend_hash_clean()
1711 Bucket *p, *end; in zend_symtable_clean() local
1717 p = ht->arData; in zend_symtable_clean()
1718 end = p + ht->nNumUsed; in zend_symtable_clean()
1721 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1722 } while (++p != end); in zend_symtable_clean()
1725 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1726 if (EXPECTED(p->key)) { in zend_symtable_clean()
1727 zend_string_release(p->key); in zend_symtable_clean()
1729 } while (++p != end); in zend_symtable_clean()
1732 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_symtable_clean()
1733 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1734 if (EXPECTED(p->key)) { in zend_symtable_clean()
1735 zend_string_release(p->key); in zend_symtable_clean()
1738 } while (++p != end); in zend_symtable_clean()
1751 Bucket *p; in zend_hash_graceful_destroy() local
1756 p = ht->arData; in zend_hash_graceful_destroy()
1757 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1758 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_destroy()
1759 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1771 Bucket *p; in zend_hash_graceful_reverse_destroy() local
1777 p = ht->arData + ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1780 p--; in zend_hash_graceful_reverse_destroy()
1781 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_reverse_destroy()
1782 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1804 Bucket *p; in zend_hash_apply() local
1810 p = ht->arData + idx; in zend_hash_apply()
1811 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply()
1812 result = apply_func(&p->val); in zend_hash_apply()
1816 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
1828 Bucket *p; in zend_hash_apply_with_argument() local
1834 p = ht->arData + idx; in zend_hash_apply_with_argument()
1835 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_argument()
1836 result = apply_func(&p->val, argument); in zend_hash_apply_with_argument()
1840 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
1852 Bucket *p; in zend_hash_apply_with_arguments() local
1860 p = ht->arData + idx; in zend_hash_apply_with_arguments()
1861 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_arguments()
1863 hash_key.h = p->h; in zend_hash_apply_with_arguments()
1864 hash_key.key = p->key; in zend_hash_apply_with_arguments()
1866 result = apply_func(&p->val, num_args, args, &hash_key); in zend_hash_apply_with_arguments()
1870 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
1884 Bucket *p; in zend_hash_reverse_apply() local
1892 p = ht->arData + idx; in zend_hash_reverse_apply()
1893 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_reverse_apply()
1895 result = apply_func(&p->val); in zend_hash_reverse_apply()
1899 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
1911 Bucket *p; in zend_hash_copy() local
1919 p = source->arData + idx; in zend_hash_copy()
1920 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_copy()
1923 data = &p->val; in zend_hash_copy()
1930 if (p->key) { in zend_hash_copy()
1931 new_entry = zend_hash_update(target, p->key, data); in zend_hash_copy()
1933 new_entry = zend_hash_index_update(target, p->h, data); in zend_hash_copy()
1942 …ray_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket *q, int pack… in zend_array_dup_element() argument
1944 zval *data = &p->val; in zend_array_dup_element()
1978 q->h = p->h; in zend_array_dup_element()
1984 q->key = p->key; in zend_array_dup_element()
1998 Bucket *p = source->arData; in zend_array_dup_packed_elements() local
2000 Bucket *end = p + source->nNumUsed; in zend_array_dup_packed_elements()
2003 if (!zend_array_dup_element(source, target, 0, p, q, 1, 1, with_holes)) { in zend_array_dup_packed_elements()
2008 p++; q++; in zend_array_dup_packed_elements()
2009 } while (p != end); in zend_array_dup_packed_elements()
2015 Bucket *p = source->arData; in zend_array_dup_elements() local
2017 Bucket *end = p + source->nNumUsed; in zend_array_dup_elements()
2020 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2023 idx++; p++; in zend_array_dup_elements()
2024 while (p != end) { in zend_array_dup_elements()
2025 if (zend_array_dup_element(source, target, target_idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2031 idx++; p++; in zend_array_dup_elements()
2035 idx++; p++; q++; in zend_array_dup_elements()
2036 } while (p != end); in zend_array_dup_elements()
2126 Bucket *p; in zend_hash_merge() local
2135 p = source->arData + idx; in zend_hash_merge()
2136 s = &p->val; in zend_hash_merge()
2143 if (p->key) { in zend_hash_merge()
2144 t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT); in zend_hash_merge()
2149 t = zend_hash_index_update(target, p->h, s); in zend_hash_merge()
2157 p = source->arData + idx; in zend_hash_merge()
2158 s = &p->val; in zend_hash_merge()
2165 if (p->key) { in zend_hash_merge()
2166 t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT); in zend_hash_merge()
2171 t = zend_hash_index_add(target, p->h, s); in zend_hash_merge()
2181 …_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge… in zend_hash_replace_checker_wrapper() argument
2185 hash_key.h = p->h; in zend_hash_replace_checker_wrapper()
2186 hash_key.key = p->key; in zend_hash_replace_checker_wrapper()
2194 Bucket *p; in zend_hash_merge_ex() local
2202 p = source->arData + idx; in zend_hash_merge_ex()
2203 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_merge_ex()
2204 if (zend_hash_replace_checker_wrapper(target, &p->val, p, pParam, pMergeSource)) { in zend_hash_merge_ex()
2205 t = zend_hash_update(target, p->key, &p->val); in zend_hash_merge_ex()
2217 Bucket *p; in zend_hash_find() local
2221 p = zend_hash_find_bucket(ht, key, 0); in zend_hash_find()
2222 return p ? &p->val : NULL; in zend_hash_find()
2227 Bucket *p; in _zend_hash_find_known_hash() local
2231 p = zend_hash_find_bucket(ht, key, 1); in _zend_hash_find_known_hash()
2232 return p ? &p->val : NULL; in _zend_hash_find_known_hash()
2238 Bucket *p; in zend_hash_str_find() local
2243 p = zend_hash_str_find_bucket(ht, str, len, h); in zend_hash_str_find()
2244 return p ? &p->val : NULL; in zend_hash_str_find()
2249 Bucket *p; in zend_hash_index_find() local
2255 p = ht->arData + h; in zend_hash_index_find()
2256 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_find()
2257 return &p->val; in zend_hash_index_find()
2263 p = zend_hash_index_find_bucket(ht, h); in zend_hash_index_find()
2264 return p ? &p->val : NULL; in zend_hash_index_find()
2269 Bucket *p; in _zend_hash_index_find() local
2273 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_find()
2274 return p ? &p->val : NULL; in _zend_hash_index_find()
2359 Bucket *p; in zend_hash_get_current_key_ex() local
2364 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2365 if (p->key) { in zend_hash_get_current_key_ex()
2366 *str_index = p->key; in zend_hash_get_current_key_ex()
2369 *num_index = p->h; in zend_hash_get_current_key_ex()
2379 Bucket *p; in zend_hash_get_current_key_zval_ex() local
2386 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2387 if (p->key) { in zend_hash_get_current_key_zval_ex()
2388 ZVAL_STR_COPY(key, p->key); in zend_hash_get_current_key_zval_ex()
2390 ZVAL_LONG(key, p->h); in zend_hash_get_current_key_zval_ex()
2398 Bucket *p; in zend_hash_get_current_key_type_ex() local
2403 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2404 if (p->key) { in zend_hash_get_current_key_type_ex()
2417 Bucket *p; in zend_hash_get_current_data_ex() local
2422 p = ht->arData + idx; in zend_hash_get_current_data_ex()
2423 return &p->val; in zend_hash_get_current_data_ex()
2429 ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q) in zend_hash_bucket_swap() argument
2435 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_swap()
2436 h = p->h; in zend_hash_bucket_swap()
2437 key = p->key; in zend_hash_bucket_swap()
2439 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_swap()
2440 p->h = q->h; in zend_hash_bucket_swap()
2441 p->key = q->key; in zend_hash_bucket_swap()
2448 ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q) in zend_hash_bucket_renum_swap() argument
2452 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_renum_swap()
2453 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_renum_swap()
2457 ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q) in zend_hash_bucket_packed_swap() argument
2462 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_packed_swap()
2463 h = p->h; in zend_hash_bucket_packed_swap()
2465 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_packed_swap()
2466 p->h = q->h; in zend_hash_bucket_packed_swap()
2474 Bucket *p; in zend_hash_sort_ex() local
2488 p = ht->arData + j; in zend_hash_sort_ex()
2489 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_sort_ex()
2491 ht->arData[i] = *p; in zend_hash_sort_ex()
2506 p = ht->arData + j; in zend_hash_sort_ex()
2507 p->h = j; in zend_hash_sort_ex()
2508 if (p->key) { in zend_hash_sort_ex()
2509 zend_string_release(p->key); in zend_hash_sort_ex()
2510 p->key = NULL; in zend_hash_sort_ex()
2651 Bucket *p, *res; in zend_hash_minmax() local
2669 p = ht->arData + idx; in zend_hash_minmax()
2670 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_minmax()
2673 if (compar(res, p) < 0) { /* max */ in zend_hash_minmax()
2674 res = p; in zend_hash_minmax()
2677 if (compar(res, p) > 0) { /* min */ in zend_hash_minmax()
2678 res = p; in zend_hash_minmax()