Module src/hash/hash-simple.c

vim:sw=4:sts=4 Simple hash lookup function (i.e., not using a minimal perfect hash function). It is always available, easy to understand, and has little code. It is therefore always compiled in. by Wolfgang 2006, 2007, 2008 Space requirement: per (key, value pair) 64 bit plus the value.

Functions

hash_search_simple (_hi, key, keylen, datalen) Given a key, look it up in the hash table.


Functions

hash_search_simple (_hi, key, keylen, datalen)
Given a key, look it up in the hash table. Returns NULL if not found, or a pointer to the data of this entry. Layout of each 64 bit bucket: 1 bit set if it is an overflow bucket 15 bit high bits of the hash value 16 bit number of the next overflow bucket 20 bit offset of the data 12 bit length of the data When the number of buckets is larger, then more of the hash value is used to compute the bucket number. No need to have more bits for the hash value in the bucket.

Parameters

  • _hi:
  • key:
  • keylen:
  • datalen:
In file: src/hash/hash-simple.c line 15

Valid XHTML 1.0!