Lines Matching refs:hash

81 S_save_hek_flags(pTHX_ const char *str, I32 len, U32 hash, int flags)
92 HEK_HASH(hek) = hash;
168 Perl_sv_setpvf(aTHX_ esv, "Attempt to %s a restricted hash", msg);
183 Stores an SV in a hash. The hash key is specified as C<key> and C<klen> is
184 the length of the key. The C<hash> parameter is the precomputed hash
187 stored within the hash (as in the case of tied hashes). Otherwise it can
193 if all your code does is create SVs then store them in a hash, hv_store
207 Perl_hv_store(pTHX_ HV *hv, const char *key, I32 klen_i32, SV *val, U32 hash)
227 register U32 hash, int flags)
230 (HV_FETCH_ISSTORE|HV_FETCH_JUST_SV), val, hash);
237 Stores C<val> in a hash. The hash key is specified as C<key>. The C<hash>
238 parameter is the precomputed hash value; if it is zero then Perl will
239 compute it. The return value is the new hash entry so created. It will be
241 stored within the hash (as in the case of tied hashes). Otherwise the
248 if all your code does is create SVs then store them in a hash, hv_store
264 Perl_hv_store_ent(pTHX_ HV *hv, SV *keysv, SV *val, U32 hash)
266 return hv_fetch_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISSTORE, val, hash);
272 Returns a boolean indicating whether the specified hash key exists. The
298 Returns the SV which corresponds to the specified key in the hash. The
332 Returns a boolean indicating whether the specified hash key exists. C<hash>
333 can be a valid precomputed hash value, or 0 to ask for it to be
340 Perl_hv_exists_ent(pTHX_ HV *hv, SV *keysv, U32 hash)
342 return hv_fetch_common(hv, keysv, NULL, 0, 0, HV_FETCH_ISEXISTS, 0, hash)
351 Returns the hash entry which corresponds to the specified key in the hash.
352 C<hash> must be a valid precomputed hash number for the given C<key>, or 0
355 accessing it. The return value when C<tb> is a tied hash is a pointer to a
366 Perl_hv_fetch_ent(pTHX_ HV *hv, SV *keysv, I32 lval, register U32 hash)
369 (lval ? HV_FETCH_LVALUE : 0), Nullsv, hash);
374 int flags, int action, SV *val, register U32 hash)
455 0 /* compute hash */);
462 NEWSV(61,0), hash);
507 hash = 0;
549 hash = 0;
600 PERL_HASH_INTERNAL(hash, key, klen);
607 } else if (!hash) {
608 /* Not enough shared hash key scalars around to make this worthwhile
611 hash = SvUVX(keysv);
615 PERL_HASH(hash, key, klen);
627 /* entry = (HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */
628 entry = ((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
631 if (HeHASH(entry) != hash) /* strings can't be equal */
642 /* We match if HVhek_UTF8 bit in our flags and hash key's
650 HEK *new_hek = share_hek_flags(key, klen, hash,
706 hash);
730 HV_FETCH_ISSTORE, val, hash);
747 oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
753 HeKEY_hek(entry) = share_hek_flags(key, klen, hash, flags);
755 HeKEY_hek(entry) = save_hek_flags(key, klen, hash, flags);
771 splits on a rehashed hash, as we're not going to split it again,
804 Evaluates the hash in scalar context and returns the result. Handles magic when the hash is tied.
833 Deletes a key/value pair in the hash. The value SV is removed from the
834 hash and returned to the caller. The C<klen> is the length of the key.
859 Deletes a key/value pair in the hash. The value SV is removed from the
860 hash and returned to the caller. The C<flags> value will normally be zero;
861 if set to G_DISCARD then NULL will be returned. C<hash> can be a valid
862 precomputed hash value, or 0 to ask for it to be computed.
868 Perl_hv_delete_ent(pTHX_ HV *hv, SV *keysv, I32 flags, U32 hash)
870 return hv_delete_common(hv, keysv, NULL, 0, 0, flags, hash);
875 int k_flags, I32 d_flags, U32 hash)
906 Nullsv, hash);
930 hash = 0;
960 PERL_HASH_INTERNAL(hash, key, klen);
961 } else if (!hash) {
962 /* Not enough shared hash key scalars around to make this worthwhile
965 hash = SvUVX(keysv);
969 PERL_HASH(hash, key, klen);
975 /* oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */
976 oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
980 if (HeHASH(entry) != hash) /* strings can't be equal */
1012 * If a restricted hash, rather than really deleting the entry, put
1070 Storable always pre-splits the hash. */
1166 into the new hash below, so store where we go next. */
1168 UV hash;
1171 PERL_HASH_INTERNAL(hash, HeKEY(entry), HeKLEN(entry));
1177 hash, HeKFLAGS(entry));
1181 /* Not shared, so simply write the new hash in. */
1182 HeHASH(entry) = hash;
1189 bep = ((HE**)a) + (hash & (I32) xhv->xhv_max);
1322 /* It's an ordinary hash, so copy it fast. AMS 20010804 */
1341 U32 hash = HeHASH(oent);
1349 = shared ? share_hek_flags(key, len, hash, flags)
1350 : save_hek_flags(key, len, hash, flags);
1433 Clears a hash, making it empty.
1448 /* restricted hash: convert all keys to placeholders */
1459 "Attempt to delete readonly key '%"SVf"' from a restricted hash",
1489 Clears any placeholders from a hash. If a restricted hash has any of its keys
1492 it so it will be ignored by future operations such as iterating over the hash,
1493 but will still allow the hash to have a value reaasigned to the key at some
1494 future point. This function clears any such placeholder keys from the hash.
1590 Undefines the hash.
1610 xhv->xhv_max = 7; /* HvMAX(hv) = 7 (it's a normal hash) */
1621 Prepares a starting point to traverse a hash table. Returns the number of
1622 keys in the hash (i.e. the same as C<HvKEYS(tb)>). The return value is
1626 hash buckets that happen to be in use. If you still need that esoteric
1640 Perl_croak(aTHX_ "Bad hash");
1655 Returns entries from a hash iterator. See C<hv_iterinit>.
1657 You may call C<hv_delete> or C<hv_delete_ent> on the hash entry that the
1659 iterator. Note that in this case the current entry is deleted from the hash
1677 Returns entries from a hash iterator. See C<hv_iterinit> and C<hv_iternext>.
1698 Perl_croak(aTHX_ "Bad hash");
1712 /* one HE per MAGICAL hash */
1742 /* At start of hash, entry is NULL. */
1761 /* There is no next one. End of the hash. */
1794 Returns the key from the current position of the hash iterator. See
1819 Returns the key as an C<SV*> from the current position of the hash
1848 that would contain the (wrong) hash value, and might get passed
1849 into an hv routine with a regular hash */
1867 Returns the value from the current position of the hash iterator. See
1910 Adds magic to a hash. See C<sv_magic>.
1924 Perl_sharepvn(pTHX_ const char *sv, I32 len, U32 hash)
1926 return HEK_KEY(share_hek(sv, len, hash));
1932 * len and hash must both be valid for str.
1935 Perl_unsharepvn(pTHX_ const char *str, I32 len, U32 hash)
1937 unshare_hek_or_pvn (NULL, str, len, hash);
1948 hek if non-NULL takes priority over the other 3, else str, len and hash
1949 are used. If so, len and hash must both be valid for str.
1952 S_unshare_hek_or_pvn(pTHX_ HEK *hek, const char *str, I32 len, U32 hash)
1964 hash = HEK_HASH(hek);
1978 if ((Svp = hv_fetch(PL_strtab, tmpsv, FALSE, hash))) {
1980 hv_delete(PL_strtab, str, len, G_DISCARD, hash);
1985 /* oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */
1986 oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
1997 if (HeHASH(entry) != hash) /* strings can't be equal */
2033 * len and hash must both be valid for str.
2036 Perl_share_hek(pTHX_ const char *str, I32 len, register U32 hash)
2059 return share_hek_flags (str, len, hash, flags);
2063 S_share_hek_flags(pTHX_ const char *str, I32 len, register U32 hash, int flags)
2075 hv_store(PL_strtab, str, len, Nullsv, hash);
2083 /* oentry = &(HvARRAY(hv))[hash & (I32) HvMAX(hv)]; */
2084 oentry = &((HE**)xhv->xhv_array)[hash & (I32) xhv->xhv_max];
2086 if (HeHASH(entry) != hash) /* strings can't be equal */
2099 HeKEY_hek(entry) = save_hek_flags(str, len, hash, flags_masked);