Lines Matching refs:hash

37  * Get a modulus for a hash function that is tolerably likely to be
41 * This works well in practice for hash tables up to at least 100
42 * times the square of the last prime and better than a multiplicative hash.
212 rrl->hash != NULL) {
221 rrl->hash->length, rate);
248 get_bin(dns_rrl_hash_t *hash, unsigned int hval) {
249 INSIST(hash != NULL);
250 return (&hash->bins[hval % hash->length]);
278 dns_rrl_hash_t *hash;
287 * Use a small hash table load factor.
289 old_bins = (rrl->hash == NULL) ? 0 : rrl->hash->length;
295 hsize = sizeof(dns_rrl_hash_t) + (new_bins-1)*sizeof(hash->bins[0]);
296 hash = isc_mem_get(rrl->mctx, hsize);
297 if (hash == NULL) {
301 " RRL hash table",
305 memset(hash, 0, hsize);
306 hash->length = new_bins;
308 hash->gen = rrl->hash_gen;
321 rrl->old_hash = rrl->hash;
324 rrl->hash = hash;
342 * Expand the hash table if it is time and necessary.
344 * old hash table. It will migrate to the new hash table the next
345 * time it is used or be cut loose when the old hash table is destroyed.
350 delta_rrl_time(rrl->hash->check_time, now) > 1) {
353 rrl->hash->check_time = now;
379 * Construct the hash table key.
380 * Use a hash of the DNS query name to save space in the database.
495 dns_rrl_hash_t *hash;
503 * Look for the entry in the current hash table.
505 new_bin = get_bin(rrl->hash, hval);
518 * Look in the old hash table.
535 * Discard prevous hash table when all of its entries are old.
573 hash = rrl->hash;
575 hash = rrl->old_hash;
576 old_bin = get_bin(hash, hash_key(&e->key));
1266 h = rrl->hash;