From a59795c9860a9a31e6ccf3555ef0e0ca04a0dd87 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin" Date: Tue, 2 Oct 2007 17:40:00 -0700 Subject: Use the crc64 we already use as the perfect hash function prehash Use the same crc64 that we already use for the symbol table hash as the perfect hash function prehash. We appear to get radically faster convergence this way, and the crc64 is probably *faster*, since the table likely to be resident in memory. --- hashtbl.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'hashtbl.h') diff --git a/hashtbl.h b/hashtbl.h index a5211414..c8f23bd4 100644 --- a/hashtbl.h +++ b/hashtbl.h @@ -30,8 +30,10 @@ struct hash_insert { struct hash_tbl_node *where; }; -uint64_t crc64(const char *string); -uint64_t crc64i(const char *string); +uint64_t crc64(uint64_t crc, const char *string); +uint64_t crc64i(uint64_t crc, const char *string); +#define CRC64_INIT UINT64_C(0xffffffffffffffff) + struct hash_table *hash_init(void); void **hash_find(struct hash_table *head, const char *string, struct hash_insert *insert); -- cgit v1.2.1