Lines Matching refs:p
288 Bucket *p; in zend_new_pair() local
294 p = ht->arData; in zend_new_pair()
295 ZVAL_COPY_VALUE(&p->val, val1); in zend_new_pair()
296 p->h = 0; in zend_new_pair()
297 p->key = NULL; in zend_new_pair()
299 p++; in zend_new_pair()
300 ZVAL_COPY_VALUE(&p->val, val2); in zend_new_pair()
301 p->h = 1; in zend_new_pair()
302 p->key = NULL; in zend_new_pair()
416 Bucket *p, *end, *arData; in zend_hash_discard() local
420 p = arData + ht->nNumUsed; in zend_hash_discard()
423 while (p != end) { in zend_hash_discard()
424 p--; in zend_hash_discard()
425 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_discard()
429 if (!(Z_NEXT(p->val) == HT_INVALID_IDX || HT_HASH_TO_BUCKET_EX(arData, Z_NEXT(p->val)) < p)) { in zend_hash_discard()
433 nIndex = p->h | ht->nTableMask; in zend_hash_discard()
434 HT_HASH_EX(arData, nIndex) = Z_NEXT(p->val); in zend_hash_discard()
656 Bucket *p, *arData; in zend_hash_find_bucket() local
671 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
672 if (EXPECTED(p->key == key)) { /* check for the same interned string */ in zend_hash_find_bucket()
673 return p; in zend_hash_find_bucket()
677 if (p->h == ZSTR_H(key) && in zend_hash_find_bucket()
678 EXPECTED(p->key) && in zend_hash_find_bucket()
679 zend_string_equal_content(p->key, key)) { in zend_hash_find_bucket()
680 return p; in zend_hash_find_bucket()
682 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
686 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
687 if (p->key == key) { /* check for the same interned string */ in zend_hash_find_bucket()
688 return p; in zend_hash_find_bucket()
697 Bucket *p, *arData; in zend_hash_str_find_bucket() local
704 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
705 if ((p->h == h) in zend_hash_str_find_bucket()
706 && p->key in zend_hash_str_find_bucket()
707 && (ZSTR_LEN(p->key) == len) in zend_hash_str_find_bucket()
708 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_find_bucket()
709 return p; in zend_hash_str_find_bucket()
711 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
720 Bucket *p, *arData; in zend_hash_index_find_bucket() local
727 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
728 if (p->h == h && !p->key) { in zend_hash_index_find_bucket()
729 return p; in zend_hash_index_find_bucket()
731 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
741 Bucket *p, *arData; in _zend_hash_add_or_update_i() local
758 p = zend_hash_find_bucket(ht, key, 1); in _zend_hash_add_or_update_i()
760 if (p) { in _zend_hash_add_or_update_i()
765 return &p->val; in _zend_hash_add_or_update_i()
770 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
771 data = &p->val; in _zend_hash_add_or_update_i()
781 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
782 data = &p->val; in _zend_hash_add_or_update_i()
805 p = arData + idx; in _zend_hash_add_or_update_i()
806 p->key = key; in _zend_hash_add_or_update_i()
807 p->h = h = ZSTR_H(key); in _zend_hash_add_or_update_i()
809 Z_NEXT(p->val) = HT_HASH_EX(arData, nIndex); in _zend_hash_add_or_update_i()
812 ZVAL_NULL(&p->val); in _zend_hash_add_or_update_i()
814 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_add_or_update_i()
817 return &p->val; in _zend_hash_add_or_update_i()
825 Bucket *p; in _zend_hash_str_add_or_update_i() local
838 p = zend_hash_str_find_bucket(ht, str, len, h); in _zend_hash_str_add_or_update_i()
840 if (p) { in _zend_hash_str_add_or_update_i()
844 return &p->val; in _zend_hash_str_add_or_update_i()
849 ZEND_ASSERT(&p->val != pData); in _zend_hash_str_add_or_update_i()
850 data = &p->val; in _zend_hash_str_add_or_update_i()
860 ZEND_ASSERT(&p->val != pData); in _zend_hash_str_add_or_update_i()
861 data = &p->val; in _zend_hash_str_add_or_update_i()
879 p = ht->arData + idx; in _zend_hash_str_add_or_update_i()
880 p->key = key = zend_string_init(str, len, GC_FLAGS(ht) & IS_ARRAY_PERSISTENT); in _zend_hash_str_add_or_update_i()
886 p->h = ZSTR_H(key) = h; in _zend_hash_str_add_or_update_i()
889 ZVAL_NULL(&p->val); in _zend_hash_str_add_or_update_i()
891 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_str_add_or_update_i()
894 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_str_add_or_update_i()
897 return &p->val; in _zend_hash_str_add_or_update_i()
1009 Bucket *p; in _zend_hash_index_add_or_update_i() local
1021 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
1022 if (Z_TYPE(p->val) != IS_UNDEF) { in _zend_hash_index_add_or_update_i()
1024 return &p->val; in _zend_hash_index_add_or_update_i()
1031 ht->pDestructor(&p->val); in _zend_hash_index_add_or_update_i()
1033 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
1034 return &p->val; in _zend_hash_index_add_or_update_i()
1040 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
1045 while (q != p) { in _zend_hash_index_add_or_update_i()
1072 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_add_or_update_i()
1073 if (p) { in _zend_hash_index_add_or_update_i()
1075 return &p->val; in _zend_hash_index_add_or_update_i()
1086 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
1087 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_index_add_or_update_i()
1094 p->h = h; in _zend_hash_index_add_or_update_i()
1095 p->key = NULL; in _zend_hash_index_add_or_update_i()
1097 ZVAL_NULL(&p->val); in _zend_hash_index_add_or_update_i()
1099 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
1102 return &p->val; in _zend_hash_index_add_or_update_i()
1157 Bucket *p, *arData; in zend_hash_set_bucket_key() local
1163 p = zend_hash_find_bucket(ht, key, 0); in zend_hash_set_bucket_key()
1164 if (UNEXPECTED(p)) { in zend_hash_set_bucket_key()
1165 return (p == b) ? &p->val : NULL; in zend_hash_set_bucket_key()
1182 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1183 while (Z_NEXT(p->val) != idx) { in zend_hash_set_bucket_key()
1184 i = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1185 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1187 Z_NEXT(p->val) = Z_NEXT(b->val); in zend_hash_set_bucket_key()
1202 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1203 while (Z_NEXT(p->val) != HT_INVALID_IDX && Z_NEXT(p->val) > idx) { in zend_hash_set_bucket_key()
1204 i = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1205 p = HT_HASH_TO_BUCKET_EX(arData, i); in zend_hash_set_bucket_key()
1207 Z_NEXT(b->val) = Z_NEXT(p->val); in zend_hash_set_bucket_key()
1208 Z_NEXT(p->val) = idx; in zend_hash_set_bucket_key()
1242 Bucket *p; in zend_hash_rehash() local
1257 p = ht->arData; in zend_hash_rehash()
1260 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
1261 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
1263 p++; in zend_hash_rehash()
1268 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) { in zend_hash_rehash()
1270 Bucket *q = p; in zend_hash_rehash()
1274 p++; in zend_hash_rehash()
1275 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
1276 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
1277 q->h = p->h; in zend_hash_rehash()
1279 q->key = p->key; in zend_hash_rehash()
1293 p++; in zend_hash_rehash()
1294 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
1295 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
1296 q->h = p->h; in zend_hash_rehash()
1298 q->key = p->key; in zend_hash_rehash()
1318 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
1319 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
1321 p++; in zend_hash_rehash()
1332 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
1336 Z_NEXT(prev->val) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
1338 HT_HASH(ht, p->h | ht->nTableMask) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
1366 if (p->key) { in _zend_hash_del_el_ex()
1367 zend_string_release(p->key); in _zend_hash_del_el_ex()
1371 ZVAL_COPY_VALUE(&tmp, &p->val); in _zend_hash_del_el_ex()
1372 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1375 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1379 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1384 uint32_t nIndex = p->h | ht->nTableMask; in _zend_hash_del_el()
1396 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1399 ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p) in zend_hash_del_bucket() argument
1403 _zend_hash_del_el(ht, HT_IDX_TO_HASH(p - ht->arData), p); in zend_hash_del_bucket()
1411 Bucket *p; in zend_hash_del() local
1422 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1423 if ((p->key == key) || in zend_hash_del()
1424 (p->h == h && in zend_hash_del()
1425 p->key && in zend_hash_del()
1426 zend_string_equal_content(p->key, key))) { in zend_hash_del()
1427 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1430 prev = p; in zend_hash_del()
1431 idx = Z_NEXT(p->val); in zend_hash_del()
1441 Bucket *p; in zend_hash_del_ind() local
1452 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1453 if ((p->key == key) || in zend_hash_del_ind()
1454 (p->h == h && in zend_hash_del_ind()
1455 p->key && in zend_hash_del_ind()
1456 zend_string_equal_content(p->key, key))) { in zend_hash_del_ind()
1457 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_del_ind()
1458 zval *data = Z_INDIRECT(p->val); in zend_hash_del_ind()
1474 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1478 prev = p; in zend_hash_del_ind()
1479 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1489 Bucket *p; in zend_hash_str_del_ind() local
1500 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1501 if ((p->h == h) in zend_hash_str_del_ind()
1502 && p->key in zend_hash_str_del_ind()
1503 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del_ind()
1504 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del_ind()
1505 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_str_del_ind()
1506 zval *data = Z_INDIRECT(p->val); in zend_hash_str_del_ind()
1518 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1522 prev = p; in zend_hash_str_del_ind()
1523 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1533 Bucket *p; in zend_hash_str_del() local
1544 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1545 if ((p->h == h) in zend_hash_str_del()
1546 && p->key in zend_hash_str_del()
1547 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del()
1548 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del()
1549 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1552 prev = p; in zend_hash_str_del()
1553 idx = Z_NEXT(p->val); in zend_hash_str_del()
1562 Bucket *p; in zend_hash_index_del() local
1570 p = ht->arData + h; in zend_hash_index_del()
1571 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_del()
1572 _zend_hash_del_el_ex(ht, HT_IDX_TO_HASH(h), p, NULL); in zend_hash_index_del()
1582 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1583 if ((p->h == h) && (p->key == NULL)) { in zend_hash_index_del()
1584 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1587 prev = p; in zend_hash_index_del()
1588 idx = Z_NEXT(p->val); in zend_hash_index_del()
1595 Bucket *p, *end; in zend_hash_destroy() local
1601 p = ht->arData; in zend_hash_destroy()
1602 end = p + ht->nNumUsed; in zend_hash_destroy()
1609 ht->pDestructor(&p->val); in zend_hash_destroy()
1610 } while (++p != end); in zend_hash_destroy()
1613 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1614 ht->pDestructor(&p->val); in zend_hash_destroy()
1616 } while (++p != end); in zend_hash_destroy()
1620 ht->pDestructor(&p->val); in zend_hash_destroy()
1621 if (EXPECTED(p->key)) { in zend_hash_destroy()
1622 zend_string_release(p->key); in zend_hash_destroy()
1624 } while (++p != end); in zend_hash_destroy()
1627 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1628 ht->pDestructor(&p->val); in zend_hash_destroy()
1629 if (EXPECTED(p->key)) { in zend_hash_destroy()
1630 zend_string_release(p->key); in zend_hash_destroy()
1633 } while (++p != end); in zend_hash_destroy()
1640 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1641 if (EXPECTED(p->key)) { in zend_hash_destroy()
1642 zend_string_release(p->key); in zend_hash_destroy()
1645 } while (++p != end); in zend_hash_destroy()
1657 Bucket *p, *end; in zend_array_destroy() local
1673 p = ht->arData; in zend_array_destroy()
1674 end = p + ht->nNumUsed; in zend_array_destroy()
1679 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1680 } while (++p != end); in zend_array_destroy()
1683 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1684 if (EXPECTED(p->key)) { in zend_array_destroy()
1685 zend_string_release_ex(p->key, 0); in zend_array_destroy()
1687 } while (++p != end); in zend_array_destroy()
1690 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_array_destroy()
1691 i_zval_ptr_dtor(&p->val); in zend_array_destroy()
1692 if (EXPECTED(p->key)) { in zend_array_destroy()
1693 zend_string_release_ex(p->key, 0); in zend_array_destroy()
1696 } while (++p != end); in zend_array_destroy()
1710 Bucket *p, *end; in zend_hash_clean() local
1716 p = ht->arData; in zend_hash_clean()
1717 end = p + ht->nNumUsed; in zend_hash_clean()
1722 ht->pDestructor(&p->val); in zend_hash_clean()
1723 } while (++p != end); in zend_hash_clean()
1726 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1727 ht->pDestructor(&p->val); in zend_hash_clean()
1729 } while (++p != end); in zend_hash_clean()
1733 ht->pDestructor(&p->val); in zend_hash_clean()
1734 if (EXPECTED(p->key)) { in zend_hash_clean()
1735 zend_string_release(p->key); in zend_hash_clean()
1737 } while (++p != end); in zend_hash_clean()
1740 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1741 ht->pDestructor(&p->val); in zend_hash_clean()
1742 if (EXPECTED(p->key)) { in zend_hash_clean()
1743 zend_string_release(p->key); in zend_hash_clean()
1746 } while (++p != end); in zend_hash_clean()
1752 if (EXPECTED(p->key)) { in zend_hash_clean()
1753 zend_string_release(p->key); in zend_hash_clean()
1755 } while (++p != end); in zend_hash_clean()
1758 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1759 if (EXPECTED(p->key)) { in zend_hash_clean()
1760 zend_string_release(p->key); in zend_hash_clean()
1763 } while (++p != end); in zend_hash_clean()
1779 Bucket *p, *end; in zend_symtable_clean() local
1785 p = ht->arData; in zend_symtable_clean()
1786 end = p + ht->nNumUsed; in zend_symtable_clean()
1789 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1790 } while (++p != end); in zend_symtable_clean()
1793 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1794 if (EXPECTED(p->key)) { in zend_symtable_clean()
1795 zend_string_release(p->key); in zend_symtable_clean()
1797 } while (++p != end); in zend_symtable_clean()
1800 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_symtable_clean()
1801 i_zval_ptr_dtor(&p->val); in zend_symtable_clean()
1802 if (EXPECTED(p->key)) { in zend_symtable_clean()
1803 zend_string_release(p->key); in zend_symtable_clean()
1806 } while (++p != end); in zend_symtable_clean()
1819 Bucket *p; in zend_hash_graceful_destroy() local
1824 p = ht->arData; in zend_hash_graceful_destroy()
1825 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1826 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_destroy()
1827 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1839 Bucket *p; in zend_hash_graceful_reverse_destroy() local
1845 p = ht->arData + ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1848 p--; in zend_hash_graceful_reverse_destroy()
1849 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_reverse_destroy()
1850 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1872 Bucket *p; in zend_hash_apply() local
1878 p = ht->arData + idx; in zend_hash_apply()
1879 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply()
1880 result = apply_func(&p->val); in zend_hash_apply()
1884 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
1896 Bucket *p; in zend_hash_apply_with_argument() local
1902 p = ht->arData + idx; in zend_hash_apply_with_argument()
1903 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_argument()
1904 result = apply_func(&p->val, argument); in zend_hash_apply_with_argument()
1908 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
1920 Bucket *p; in zend_hash_apply_with_arguments() local
1928 p = ht->arData + idx; in zend_hash_apply_with_arguments()
1929 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_arguments()
1931 hash_key.h = p->h; in zend_hash_apply_with_arguments()
1932 hash_key.key = p->key; in zend_hash_apply_with_arguments()
1934 result = apply_func(&p->val, num_args, args, &hash_key); in zend_hash_apply_with_arguments()
1938 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
1952 Bucket *p; in zend_hash_reverse_apply() local
1960 p = ht->arData + idx; in zend_hash_reverse_apply()
1961 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_reverse_apply()
1963 result = apply_func(&p->val); in zend_hash_reverse_apply()
1967 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
1979 Bucket *p; in zend_hash_copy() local
1987 p = source->arData + idx; in zend_hash_copy()
1988 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_copy()
1991 data = &p->val; in zend_hash_copy()
1998 if (p->key) { in zend_hash_copy()
1999 new_entry = zend_hash_update(target, p->key, data); in zend_hash_copy()
2001 new_entry = zend_hash_index_update(target, p->h, data); in zend_hash_copy()
2010 …ray_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket *q, bool pac… in zend_array_dup_element() argument
2012 zval *data = &p->val; in zend_array_dup_element()
2046 q->h = p->h; in zend_array_dup_element()
2052 q->key = p->key; in zend_array_dup_element()
2066 Bucket *p = source->arData; in zend_array_dup_packed_elements() local
2068 Bucket *end = p + source->nNumUsed; in zend_array_dup_packed_elements()
2071 if (!zend_array_dup_element(source, target, 0, p, q, 1, 1, with_holes)) { in zend_array_dup_packed_elements()
2076 p++; q++; in zend_array_dup_packed_elements()
2077 } while (p != end); in zend_array_dup_packed_elements()
2083 Bucket *p = source->arData; in zend_array_dup_elements() local
2085 Bucket *end = p + source->nNumUsed; in zend_array_dup_elements()
2088 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2091 idx++; p++; in zend_array_dup_elements()
2092 while (p != end) { in zend_array_dup_elements()
2093 if (zend_array_dup_element(source, target, target_idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
2099 idx++; p++; in zend_array_dup_elements()
2103 idx++; p++; q++; in zend_array_dup_elements()
2104 } while (p != end); in zend_array_dup_elements()
2194 Bucket *p; in zend_hash_merge() local
2203 p = source->arData + idx; in zend_hash_merge()
2204 s = &p->val; in zend_hash_merge()
2211 if (p->key) { in zend_hash_merge()
2212 t = _zend_hash_add_or_update_i(target, p->key, s, HASH_UPDATE | HASH_UPDATE_INDIRECT); in zend_hash_merge()
2217 t = zend_hash_index_update(target, p->h, s); in zend_hash_merge()
2225 p = source->arData + idx; in zend_hash_merge()
2226 s = &p->val; in zend_hash_merge()
2233 if (p->key) { in zend_hash_merge()
2234 t = _zend_hash_add_or_update_i(target, p->key, s, HASH_ADD | HASH_UPDATE_INDIRECT); in zend_hash_merge()
2239 t = zend_hash_index_add(target, p->h, s); in zend_hash_merge()
2249 …_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge… in zend_hash_replace_checker_wrapper() argument
2253 hash_key.h = p->h; in zend_hash_replace_checker_wrapper()
2254 hash_key.key = p->key; in zend_hash_replace_checker_wrapper()
2262 Bucket *p; in zend_hash_merge_ex() local
2270 p = source->arData + idx; in zend_hash_merge_ex()
2271 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_merge_ex()
2272 if (zend_hash_replace_checker_wrapper(target, &p->val, p, pParam, pMergeSource)) { in zend_hash_merge_ex()
2273 t = zend_hash_update(target, p->key, &p->val); in zend_hash_merge_ex()
2285 Bucket *p; in zend_hash_find() local
2289 p = zend_hash_find_bucket(ht, key, 0); in zend_hash_find()
2290 return p ? &p->val : NULL; in zend_hash_find()
2295 Bucket *p; in zend_hash_find_known_hash() local
2299 p = zend_hash_find_bucket(ht, key, 1); in zend_hash_find_known_hash()
2300 return p ? &p->val : NULL; in zend_hash_find_known_hash()
2306 Bucket *p; in zend_hash_str_find() local
2311 p = zend_hash_str_find_bucket(ht, str, len, h); in zend_hash_str_find()
2312 return p ? &p->val : NULL; in zend_hash_str_find()
2317 Bucket *p; in zend_hash_index_find() local
2323 p = ht->arData + h; in zend_hash_index_find()
2324 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_find()
2325 return &p->val; in zend_hash_index_find()
2331 p = zend_hash_index_find_bucket(ht, h); in zend_hash_index_find()
2332 return p ? &p->val : NULL; in zend_hash_index_find()
2337 Bucket *p; in _zend_hash_index_find() local
2341 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_find()
2342 return p ? &p->val : NULL; in _zend_hash_index_find()
2427 Bucket *p; in zend_hash_get_current_key_ex() local
2432 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2433 if (p->key) { in zend_hash_get_current_key_ex()
2434 *str_index = p->key; in zend_hash_get_current_key_ex()
2437 *num_index = p->h; in zend_hash_get_current_key_ex()
2447 Bucket *p; in zend_hash_get_current_key_zval_ex() local
2454 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2455 if (p->key) { in zend_hash_get_current_key_zval_ex()
2456 ZVAL_STR_COPY(key, p->key); in zend_hash_get_current_key_zval_ex()
2458 ZVAL_LONG(key, p->h); in zend_hash_get_current_key_zval_ex()
2466 Bucket *p; in zend_hash_get_current_key_type_ex() local
2471 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2472 if (p->key) { in zend_hash_get_current_key_type_ex()
2485 Bucket *p; in zend_hash_get_current_data_ex() local
2490 p = ht->arData + idx; in zend_hash_get_current_data_ex()
2491 return &p->val; in zend_hash_get_current_data_ex()
2497 ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q) in zend_hash_bucket_swap() argument
2503 val = p->val; in zend_hash_bucket_swap()
2504 h = p->h; in zend_hash_bucket_swap()
2505 key = p->key; in zend_hash_bucket_swap()
2507 p->val = q->val; in zend_hash_bucket_swap()
2508 p->h = q->h; in zend_hash_bucket_swap()
2509 p->key = q->key; in zend_hash_bucket_swap()
2516 ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q) in zend_hash_bucket_renum_swap() argument
2520 val = p->val; in zend_hash_bucket_renum_swap()
2521 p->val = q->val; in zend_hash_bucket_renum_swap()
2525 ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q) in zend_hash_bucket_packed_swap() argument
2530 val = p->val; in zend_hash_bucket_packed_swap()
2531 h = p->h; in zend_hash_bucket_packed_swap()
2533 p->val = q->val; in zend_hash_bucket_packed_swap()
2534 p->h = q->h; in zend_hash_bucket_packed_swap()
2542 Bucket *p; in zend_hash_sort_ex() local
2561 p = ht->arData + j; in zend_hash_sort_ex()
2562 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_sort_ex()
2564 ht->arData[i] = *p; in zend_hash_sort_ex()
2590 p = ht->arData + j; in zend_hash_sort_ex()
2591 p->h = j; in zend_hash_sort_ex()
2592 if (p->key) { in zend_hash_sort_ex()
2593 zend_string_release(p->key); in zend_hash_sort_ex()
2594 p->key = NULL; in zend_hash_sort_ex()
2729 Bucket *p, *res; in zend_hash_minmax() local
2747 p = ht->arData + idx; in zend_hash_minmax()
2748 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_minmax()
2751 if (compar(res, p) < 0) { /* max */ in zend_hash_minmax()
2752 res = p; in zend_hash_minmax()
2755 if (compar(res, p) > 0) { /* min */ in zend_hash_minmax()
2756 res = p; in zend_hash_minmax()