summaryrefslogtreecommitdiff
path: root/hashtbl.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-10-02 17:40:00 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-10-02 17:40:00 -0700
commita59795c9860a9a31e6ccf3555ef0e0ca04a0dd87 (patch)
tree608679c4a8021e3e2e28644d1e3059a5e0091e4c /hashtbl.h
parent17394a7d8e3240c6dafddab7725d953904208e5a (diff)
downloadnasm-a59795c9860a9a31e6ccf3555ef0e0ca04a0dd87.tar.gz
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.
Diffstat (limited to 'hashtbl.h')
-rw-r--r--hashtbl.h6
1 files changed, 4 insertions, 2 deletions
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);