]> mj.ucw.cz Git - libucw.git/commit
The universal hash table generator now uses prime table sizes instead of
authorMartin Mares <mj@ucw.cz>
Sat, 8 Jun 2002 13:17:39 +0000 (13:17 +0000)
committerMartin Mares <mj@ucw.cz>
Sat, 8 Jun 2002 13:17:39 +0000 (13:17 +0000)
commit4a220521e7b46263b156a6c784856a996997df76
treefee2848d3929348eb3f81d17918c7b5a65194c5f
parent9f83781a1e13f58813de1dddf239984097169559
The universal hash table generator now uses prime table sizes instead of
powers of two. This slows down all operations a little as we now need
to perform division instead of just AND-ing with a mask, but it allows
us to use the new hash functions in hashfunc.h which are significantly
faster than the original ones (at the expense of having bad distribution
modulo non-primes).

Also changed the limit logic to avoid rehashing when the table is already
too small or too large.
lib/hash-test.c
lib/hashtable.h