Lines Matching refs:p
477 Bucket *p, *arData; in zend_hash_find_bucket() local
484 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_find_bucket()
485 if (EXPECTED(p->key == key)) { /* check for the same interned string */ in zend_hash_find_bucket()
486 return p; in zend_hash_find_bucket()
487 } else if (EXPECTED(p->h == h) && in zend_hash_find_bucket()
488 EXPECTED(p->key) && in zend_hash_find_bucket()
489 EXPECTED(ZSTR_LEN(p->key) == ZSTR_LEN(key)) && in zend_hash_find_bucket()
490 EXPECTED(memcmp(ZSTR_VAL(p->key), ZSTR_VAL(key), ZSTR_LEN(key)) == 0)) { in zend_hash_find_bucket()
491 return p; in zend_hash_find_bucket()
493 idx = Z_NEXT(p->val); in zend_hash_find_bucket()
502 Bucket *p, *arData; in zend_hash_str_find_bucket() local
509 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_str_find_bucket()
510 if ((p->h == h) in zend_hash_str_find_bucket()
511 && p->key in zend_hash_str_find_bucket()
512 && (ZSTR_LEN(p->key) == len) in zend_hash_str_find_bucket()
513 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_find_bucket()
514 return p; in zend_hash_str_find_bucket()
516 idx = Z_NEXT(p->val); in zend_hash_str_find_bucket()
525 Bucket *p, *arData; in zend_hash_index_find_bucket() local
532 p = HT_HASH_TO_BUCKET_EX(arData, idx); in zend_hash_index_find_bucket()
533 if (p->h == h && !p->key) { in zend_hash_index_find_bucket()
534 return p; in zend_hash_index_find_bucket()
536 idx = Z_NEXT(p->val); in zend_hash_index_find_bucket()
546 Bucket *p; in _zend_hash_add_or_update_i() local
557 p = zend_hash_find_bucket(ht, key); in _zend_hash_add_or_update_i()
559 if (p) { in _zend_hash_add_or_update_i()
566 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
567 data = &p->val; in _zend_hash_add_or_update_i()
577 ZEND_ASSERT(&p->val != pData); in _zend_hash_add_or_update_i()
578 data = &p->val; in _zend_hash_add_or_update_i()
600 p = ht->arData + idx; in _zend_hash_add_or_update_i()
601 p->key = key; in _zend_hash_add_or_update_i()
607 p->h = h = ZSTR_H(key); in _zend_hash_add_or_update_i()
608 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_add_or_update_i()
610 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_add_or_update_i()
613 return &p->val; in _zend_hash_add_or_update_i()
709 Bucket *p; in _zend_hash_index_add_or_update_i() local
717 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
723 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
724 if (Z_TYPE(p->val) != IS_UNDEF) { in _zend_hash_index_add_or_update_i()
729 ht->pDestructor(&p->val); in _zend_hash_index_add_or_update_i()
731 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
732 return &p->val; in _zend_hash_index_add_or_update_i()
737 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
741 p = ht->arData + h; in _zend_hash_index_add_or_update_i()
753 while (q != p) { in _zend_hash_index_add_or_update_i()
768 p->h = h; in _zend_hash_index_add_or_update_i()
769 p->key = NULL; in _zend_hash_index_add_or_update_i()
770 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
772 return &p->val; in _zend_hash_index_add_or_update_i()
777 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_add_or_update_i()
778 if (p) { in _zend_hash_index_add_or_update_i()
782 ZEND_ASSERT(&p->val != pData); in _zend_hash_index_add_or_update_i()
784 ht->pDestructor(&p->val); in _zend_hash_index_add_or_update_i()
786 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
790 return &p->val; in _zend_hash_index_add_or_update_i()
806 p = ht->arData + idx; in _zend_hash_index_add_or_update_i()
807 p->h = h; in _zend_hash_index_add_or_update_i()
808 p->key = NULL; in _zend_hash_index_add_or_update_i()
810 ZVAL_COPY_VALUE(&p->val, pData); in _zend_hash_index_add_or_update_i()
811 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in _zend_hash_index_add_or_update_i()
814 return &p->val; in _zend_hash_index_add_or_update_i()
874 Bucket *p; in zend_hash_rehash() local
889 p = ht->arData; in zend_hash_rehash()
892 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
893 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
895 p++; in zend_hash_rehash()
899 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) { in zend_hash_rehash()
901 Bucket *q = p; in zend_hash_rehash()
905 p++; in zend_hash_rehash()
906 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
907 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
908 q->h = p->h; in zend_hash_rehash()
910 q->key = p->key; in zend_hash_rehash()
924 p++; in zend_hash_rehash()
925 if (EXPECTED(Z_TYPE_INFO(p->val) != IS_UNDEF)) { in zend_hash_rehash()
926 ZVAL_COPY_VALUE(&q->val, &p->val); in zend_hash_rehash()
927 q->h = p->h; in zend_hash_rehash()
929 q->key = p->key; in zend_hash_rehash()
949 nIndex = p->h | ht->nTableMask; in zend_hash_rehash()
950 Z_NEXT(p->val) = HT_HASH(ht, nIndex); in zend_hash_rehash()
952 p++; in zend_hash_rehash()
958 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
962 Z_NEXT(prev->val) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
964 HT_HASH(ht, p->h | ht->nTableMask) = Z_NEXT(p->val); in _zend_hash_del_el_ex()
991 if (p->key) { in _zend_hash_del_el_ex()
992 zend_string_release(p->key); in _zend_hash_del_el_ex()
996 ZVAL_COPY_VALUE(&tmp, &p->val); in _zend_hash_del_el_ex()
997 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1000 ZVAL_UNDEF(&p->val); in _zend_hash_del_el_ex()
1004 static zend_always_inline void _zend_hash_del_el(HashTable *ht, uint32_t idx, Bucket *p) in _zend_hash_del_el() argument
1009 uint32_t nIndex = p->h | ht->nTableMask; in _zend_hash_del_el()
1021 _zend_hash_del_el_ex(ht, idx, p, prev); in _zend_hash_del_el()
1024 ZEND_API void ZEND_FASTCALL zend_hash_del_bucket(HashTable *ht, Bucket *p) in zend_hash_del_bucket() argument
1028 _zend_hash_del_el(ht, HT_IDX_TO_HASH(p - ht->arData), p); in zend_hash_del_bucket()
1036 Bucket *p; in zend_hash_del() local
1047 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del()
1048 if ((p->key == key) || in zend_hash_del()
1049 (p->h == h && in zend_hash_del()
1050 p->key && in zend_hash_del()
1051 ZSTR_LEN(p->key) == ZSTR_LEN(key) && in zend_hash_del()
1052 memcmp(ZSTR_VAL(p->key), ZSTR_VAL(key), ZSTR_LEN(key)) == 0)) { in zend_hash_del()
1053 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del()
1056 prev = p; in zend_hash_del()
1057 idx = Z_NEXT(p->val); in zend_hash_del()
1067 Bucket *p; in zend_hash_del_ind() local
1078 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_del_ind()
1079 if ((p->key == key) || in zend_hash_del_ind()
1080 (p->h == h && in zend_hash_del_ind()
1081 p->key && in zend_hash_del_ind()
1082 ZSTR_LEN(p->key) == ZSTR_LEN(key) && in zend_hash_del_ind()
1083 memcmp(ZSTR_VAL(p->key), ZSTR_VAL(key), ZSTR_LEN(key)) == 0)) { in zend_hash_del_ind()
1084 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_del_ind()
1085 zval *data = Z_INDIRECT(p->val); in zend_hash_del_ind()
1101 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_del_ind()
1105 prev = p; in zend_hash_del_ind()
1106 idx = Z_NEXT(p->val); in zend_hash_del_ind()
1116 Bucket *p; in zend_hash_str_del_ind() local
1127 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del_ind()
1128 if ((p->h == h) in zend_hash_str_del_ind()
1129 && p->key in zend_hash_str_del_ind()
1130 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del_ind()
1131 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del_ind()
1132 if (Z_TYPE(p->val) == IS_INDIRECT) { in zend_hash_str_del_ind()
1133 zval *data = Z_INDIRECT(p->val); in zend_hash_str_del_ind()
1145 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del_ind()
1149 prev = p; in zend_hash_str_del_ind()
1150 idx = Z_NEXT(p->val); in zend_hash_str_del_ind()
1160 Bucket *p; in zend_hash_str_del() local
1171 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_str_del()
1172 if ((p->h == h) in zend_hash_str_del()
1173 && p->key in zend_hash_str_del()
1174 && (ZSTR_LEN(p->key) == len) in zend_hash_str_del()
1175 && !memcmp(ZSTR_VAL(p->key), str, len)) { in zend_hash_str_del()
1176 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_str_del()
1179 prev = p; in zend_hash_str_del()
1180 idx = Z_NEXT(p->val); in zend_hash_str_del()
1189 Bucket *p; in zend_hash_index_del() local
1197 p = ht->arData + h; in zend_hash_index_del()
1198 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_del()
1199 _zend_hash_del_el_ex(ht, HT_IDX_TO_HASH(h), p, NULL); in zend_hash_index_del()
1209 p = HT_HASH_TO_BUCKET(ht, idx); in zend_hash_index_del()
1210 if ((p->h == h) && (p->key == NULL)) { in zend_hash_index_del()
1211 _zend_hash_del_el_ex(ht, idx, p, prev); in zend_hash_index_del()
1214 prev = p; in zend_hash_index_del()
1215 idx = Z_NEXT(p->val); in zend_hash_index_del()
1222 Bucket *p, *end; in zend_hash_destroy() local
1228 p = ht->arData; in zend_hash_destroy()
1229 end = p + ht->nNumUsed; in zend_hash_destroy()
1236 ht->pDestructor(&p->val); in zend_hash_destroy()
1237 } while (++p != end); in zend_hash_destroy()
1240 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1241 ht->pDestructor(&p->val); in zend_hash_destroy()
1243 } while (++p != end); in zend_hash_destroy()
1247 ht->pDestructor(&p->val); in zend_hash_destroy()
1248 if (EXPECTED(p->key)) { in zend_hash_destroy()
1249 zend_string_release(p->key); in zend_hash_destroy()
1251 } while (++p != end); in zend_hash_destroy()
1254 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1255 ht->pDestructor(&p->val); in zend_hash_destroy()
1256 if (EXPECTED(p->key)) { in zend_hash_destroy()
1257 zend_string_release(p->key); in zend_hash_destroy()
1260 } while (++p != end); in zend_hash_destroy()
1267 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_destroy()
1268 if (EXPECTED(p->key)) { in zend_hash_destroy()
1269 zend_string_release(p->key); in zend_hash_destroy()
1272 } while (++p != end); in zend_hash_destroy()
1284 Bucket *p, *end; in zend_array_destroy() local
1300 p = ht->arData; in zend_array_destroy()
1301 end = p + ht->nNumUsed; in zend_array_destroy()
1306 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_array_destroy()
1307 } while (++p != end); in zend_array_destroy()
1310 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_array_destroy()
1311 if (EXPECTED(p->key)) { in zend_array_destroy()
1312 zend_string_release(p->key); in zend_array_destroy()
1314 } while (++p != end); in zend_array_destroy()
1317 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_array_destroy()
1318 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_array_destroy()
1319 if (EXPECTED(p->key)) { in zend_array_destroy()
1320 zend_string_release(p->key); in zend_array_destroy()
1323 } while (++p != end); in zend_array_destroy()
1337 Bucket *p, *end; in zend_hash_clean() local
1343 p = ht->arData; in zend_hash_clean()
1344 end = p + ht->nNumUsed; in zend_hash_clean()
1349 ht->pDestructor(&p->val); in zend_hash_clean()
1350 } while (++p != end); in zend_hash_clean()
1353 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1354 ht->pDestructor(&p->val); in zend_hash_clean()
1356 } while (++p != end); in zend_hash_clean()
1360 ht->pDestructor(&p->val); in zend_hash_clean()
1361 if (EXPECTED(p->key)) { in zend_hash_clean()
1362 zend_string_release(p->key); in zend_hash_clean()
1364 } while (++p != end); in zend_hash_clean()
1367 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1368 ht->pDestructor(&p->val); in zend_hash_clean()
1369 if (EXPECTED(p->key)) { in zend_hash_clean()
1370 zend_string_release(p->key); in zend_hash_clean()
1373 } while (++p != end); in zend_hash_clean()
1379 if (EXPECTED(p->key)) { in zend_hash_clean()
1380 zend_string_release(p->key); in zend_hash_clean()
1382 } while (++p != end); in zend_hash_clean()
1385 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_hash_clean()
1386 if (EXPECTED(p->key)) { in zend_hash_clean()
1387 zend_string_release(p->key); in zend_hash_clean()
1390 } while (++p != end); in zend_hash_clean()
1406 Bucket *p, *end; in zend_symtable_clean() local
1412 p = ht->arData; in zend_symtable_clean()
1413 end = p + ht->nNumUsed; in zend_symtable_clean()
1416 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_symtable_clean()
1417 } while (++p != end); in zend_symtable_clean()
1420 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_symtable_clean()
1421 if (EXPECTED(p->key)) { in zend_symtable_clean()
1422 zend_string_release(p->key); in zend_symtable_clean()
1424 } while (++p != end); in zend_symtable_clean()
1427 if (EXPECTED(Z_TYPE(p->val) != IS_UNDEF)) { in zend_symtable_clean()
1428 i_zval_ptr_dtor(&p->val ZEND_FILE_LINE_CC); in zend_symtable_clean()
1429 if (EXPECTED(p->key)) { in zend_symtable_clean()
1430 zend_string_release(p->key); in zend_symtable_clean()
1433 } while (++p != end); in zend_symtable_clean()
1446 Bucket *p; in zend_hash_graceful_destroy() local
1451 p = ht->arData; in zend_hash_graceful_destroy()
1452 for (idx = 0; idx < ht->nNumUsed; idx++, p++) { in zend_hash_graceful_destroy()
1453 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_destroy()
1454 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_destroy()
1466 Bucket *p; in zend_hash_graceful_reverse_destroy() local
1472 p = ht->arData + ht->nNumUsed; in zend_hash_graceful_reverse_destroy()
1475 p--; in zend_hash_graceful_reverse_destroy()
1476 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_graceful_reverse_destroy()
1477 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_graceful_reverse_destroy()
1499 Bucket *p; in zend_hash_apply() local
1506 p = ht->arData + idx; in zend_hash_apply()
1507 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply()
1508 result = apply_func(&p->val); in zend_hash_apply()
1512 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply()
1525 Bucket *p; in zend_hash_apply_with_argument() local
1532 p = ht->arData + idx; in zend_hash_apply_with_argument()
1533 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_argument()
1534 result = apply_func(&p->val, argument); in zend_hash_apply_with_argument()
1538 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_argument()
1551 Bucket *p; in zend_hash_apply_with_arguments() local
1561 p = ht->arData + idx; in zend_hash_apply_with_arguments()
1562 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_apply_with_arguments()
1564 hash_key.h = p->h; in zend_hash_apply_with_arguments()
1565 hash_key.key = p->key; in zend_hash_apply_with_arguments()
1567 result = apply_func(&p->val, num_args, args, &hash_key); in zend_hash_apply_with_arguments()
1571 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_apply_with_arguments()
1587 Bucket *p; in zend_hash_reverse_apply() local
1596 p = ht->arData + idx; in zend_hash_reverse_apply()
1597 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_reverse_apply()
1599 result = apply_func(&p->val); in zend_hash_reverse_apply()
1603 _zend_hash_del_el(ht, HT_IDX_TO_HASH(idx), p); in zend_hash_reverse_apply()
1616 Bucket *p; in zend_hash_copy() local
1626 p = source->arData + idx; in zend_hash_copy()
1627 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_copy()
1633 data = &p->val; in zend_hash_copy()
1640 if (p->key) { in zend_hash_copy()
1641 new_entry = zend_hash_update(target, p->key, data); in zend_hash_copy()
1643 new_entry = zend_hash_index_update(target, p->h, data); in zend_hash_copy()
1659 …ray_dup_element(HashTable *source, HashTable *target, uint32_t idx, Bucket *p, Bucket *q, int pack… in zend_array_dup_element() argument
1661 zval *data = &p->val; in zend_array_dup_element()
1695 q->h = p->h; in zend_array_dup_element()
1701 q->key = p->key; in zend_array_dup_element()
1715 Bucket *p = source->arData; in zend_array_dup_packed_elements() local
1717 Bucket *end = p + source->nNumUsed; in zend_array_dup_packed_elements()
1720 if (!zend_array_dup_element(source, target, 0, p, q, 1, 1, with_holes)) { in zend_array_dup_packed_elements()
1725 p++; q++; in zend_array_dup_packed_elements()
1726 } while (p != end); in zend_array_dup_packed_elements()
1732 Bucket *p = source->arData; in zend_array_dup_elements() local
1734 Bucket *end = p + source->nNumUsed; in zend_array_dup_elements()
1737 if (!zend_array_dup_element(source, target, idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
1740 idx++; p++; in zend_array_dup_elements()
1741 while (p != end) { in zend_array_dup_elements()
1742 if (zend_array_dup_element(source, target, target_idx, p, q, 0, static_keys, with_holes)) { in zend_array_dup_elements()
1748 idx++; p++; in zend_array_dup_elements()
1752 idx++; p++; q++; in zend_array_dup_elements()
1753 } while (p != end); in zend_array_dup_elements()
1854 Bucket *p; in _zend_hash_merge() local
1863 p = source->arData + idx; in _zend_hash_merge()
1864 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in _zend_hash_merge()
1865 if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) && in _zend_hash_merge()
1866 UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { in _zend_hash_merge()
1869 if (p->key) { in _zend_hash_merge()
1870 …t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_UPDATE | HASH_UPDATE_INDIRECT ZEND_FI… in _zend_hash_merge()
1875 t = zend_hash_index_update(target, p->h, &p->val); in _zend_hash_merge()
1883 p = source->arData + idx; in _zend_hash_merge()
1884 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in _zend_hash_merge()
1885 if (UNEXPECTED(Z_TYPE(p->val) == IS_INDIRECT) && in _zend_hash_merge()
1886 UNEXPECTED(Z_TYPE_P(Z_INDIRECT(p->val)) == IS_UNDEF)) { in _zend_hash_merge()
1889 if (p->key) { in _zend_hash_merge()
1890 …t = _zend_hash_add_or_update_i(target, p->key, &p->val, HASH_ADD | HASH_UPDATE_INDIRECT ZEND_FILE_… in _zend_hash_merge()
1895 t = zend_hash_index_add(target, p->h, &p->val); in _zend_hash_merge()
1912 …_hash_replace_checker_wrapper(HashTable *target, zval *source_data, Bucket *p, void *pParam, merge… in zend_hash_replace_checker_wrapper() argument
1916 hash_key.h = p->h; in zend_hash_replace_checker_wrapper()
1917 hash_key.key = p->key; in zend_hash_replace_checker_wrapper()
1925 Bucket *p; in zend_hash_merge_ex() local
1933 p = source->arData + idx; in zend_hash_merge_ex()
1934 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_merge_ex()
1935 if (zend_hash_replace_checker_wrapper(target, &p->val, p, pParam, pMergeSource)) { in zend_hash_merge_ex()
1936 t = zend_hash_update(target, p->key, &p->val); in zend_hash_merge_ex()
1955 Bucket *p; in zend_hash_find() local
1959 p = zend_hash_find_bucket(ht, key); in zend_hash_find()
1960 return p ? &p->val : NULL; in zend_hash_find()
1966 Bucket *p; in zend_hash_str_find() local
1971 p = zend_hash_str_find_bucket(ht, str, len, h); in zend_hash_str_find()
1972 return p ? &p->val : NULL; in zend_hash_str_find()
1977 Bucket *p; in zend_hash_exists() local
1981 p = zend_hash_find_bucket(ht, key); in zend_hash_exists()
1982 return p ? 1 : 0; in zend_hash_exists()
1988 Bucket *p; in zend_hash_str_exists() local
1993 p = zend_hash_str_find_bucket(ht, str, len, h); in zend_hash_str_exists()
1994 return p ? 1 : 0; in zend_hash_str_exists()
1999 Bucket *p; in zend_hash_index_find() local
2005 p = ht->arData + h; in zend_hash_index_find()
2006 if (Z_TYPE(p->val) != IS_UNDEF) { in zend_hash_index_find()
2007 return &p->val; in zend_hash_index_find()
2013 p = zend_hash_index_find_bucket(ht, h); in zend_hash_index_find()
2014 return p ? &p->val : NULL; in zend_hash_index_find()
2019 Bucket *p; in _zend_hash_index_find() local
2023 p = zend_hash_index_find_bucket(ht, h); in _zend_hash_index_find()
2024 return p ? &p->val : NULL; in _zend_hash_index_find()
2029 Bucket *p; in zend_hash_index_exists() local
2042 p = zend_hash_index_find_bucket(ht, h); in zend_hash_index_exists()
2043 return p ? 1 : 0; in zend_hash_index_exists()
2137 Bucket *p; in zend_hash_get_current_key_ex() local
2141 p = ht->arData + idx; in zend_hash_get_current_key_ex()
2142 if (p->key) { in zend_hash_get_current_key_ex()
2143 *str_index = p->key; in zend_hash_get_current_key_ex()
2146 *num_index = p->h; in zend_hash_get_current_key_ex()
2156 Bucket *p; in zend_hash_get_current_key_zval_ex() local
2162 p = ht->arData + idx; in zend_hash_get_current_key_zval_ex()
2163 if (p->key) { in zend_hash_get_current_key_zval_ex()
2164 ZVAL_STR_COPY(key, p->key); in zend_hash_get_current_key_zval_ex()
2166 ZVAL_LONG(key, p->h); in zend_hash_get_current_key_zval_ex()
2174 Bucket *p; in zend_hash_get_current_key_type_ex() local
2178 p = ht->arData + idx; in zend_hash_get_current_key_type_ex()
2179 if (p->key) { in zend_hash_get_current_key_type_ex()
2192 Bucket *p; in zend_hash_get_current_data_ex() local
2196 p = ht->arData + idx; in zend_hash_get_current_data_ex()
2197 return &p->val; in zend_hash_get_current_data_ex()
2203 ZEND_API void zend_hash_bucket_swap(Bucket *p, Bucket *q) in zend_hash_bucket_swap() argument
2209 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_swap()
2210 h = p->h; in zend_hash_bucket_swap()
2211 key = p->key; in zend_hash_bucket_swap()
2213 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_swap()
2214 p->h = q->h; in zend_hash_bucket_swap()
2215 p->key = q->key; in zend_hash_bucket_swap()
2222 ZEND_API void zend_hash_bucket_renum_swap(Bucket *p, Bucket *q) in zend_hash_bucket_renum_swap() argument
2226 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_renum_swap()
2227 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_renum_swap()
2231 ZEND_API void zend_hash_bucket_packed_swap(Bucket *p, Bucket *q) in zend_hash_bucket_packed_swap() argument
2236 ZVAL_COPY_VALUE(&val, &p->val); in zend_hash_bucket_packed_swap()
2237 h = p->h; in zend_hash_bucket_packed_swap()
2239 ZVAL_COPY_VALUE(&p->val, &q->val); in zend_hash_bucket_packed_swap()
2240 p->h = q->h; in zend_hash_bucket_packed_swap()
2248 Bucket *p; in zend_hash_sort_ex() local
2262 p = ht->arData + j; in zend_hash_sort_ex()
2263 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_sort_ex()
2265 ht->arData[i] = *p; in zend_hash_sort_ex()
2280 p = ht->arData + j; in zend_hash_sort_ex()
2281 p->h = j; in zend_hash_sort_ex()
2282 if (p->key) { in zend_hash_sort_ex()
2283 zend_string_release(p->key); in zend_hash_sort_ex()
2284 p->key = NULL; in zend_hash_sort_ex()
2411 Bucket *p, *res; in zend_hash_minmax() local
2429 p = ht->arData + idx; in zend_hash_minmax()
2430 if (UNEXPECTED(Z_TYPE(p->val) == IS_UNDEF)) continue; in zend_hash_minmax()
2433 if (compar(res, p) < 0) { /* max */ in zend_hash_minmax()
2434 res = p; in zend_hash_minmax()
2437 if (compar(res, p) > 0) { /* min */ in zend_hash_minmax()
2438 res = p; in zend_hash_minmax()