Define a proper hash table library
authorH. Peter Anvin <hpa@zytor.com>
Fri, 14 Sep 2007 06:34:21 +0000 (23:34 -0700)
committerH. Peter Anvin <hpa@zytor.com>
Fri, 14 Sep 2007 16:24:38 +0000 (09:24 -0700)
commitcde08292d65072c6a3fec5ee0f0a304d5bdf301c
tree23579b5d3540b982d42374a3a19d4ebb98773e68
parent9ab60dabcca3d7c9fe9a0bb6e7e01f9295d95532
Define a proper hash table library

Define a proper hash table library, instead of the current ad hoc stuff
used for both labels and macros.  This only implements the actual
library; it is not yet used.

We use a CRC64 as a prehash.  This is almost certainly overkill,
although it is rather efficient (except, arguably, the table lookup)
on 64-bit platforms, and not all that bad on 32-bit platforms.  All we
really need is a function which produces two independent 32-bit
results which are used as the primary and secondary hash
respectively.  Either way, the prehash function is easily replacable
if/when we have a quicker alternative.
crc64.c [new file with mode: 0644]
hashtbl.c [new file with mode: 0644]
hashtbl.h [new file with mode: 0644]