summaryrefslogtreecommitdiff
path: root/hashtbl.h
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2007-09-16 17:57:25 -0700
committerH. Peter Anvin <hpa@zytor.com>2007-09-16 18:04:57 -0700
commit97a234782d6fa7fa551a27f2ede452f5a56f1745 (patch)
treee937544cbdb0ac1368b587df71b94d3169726207 /hashtbl.h
parentd2fb7a699ea8eb953313eead23180986a424271e (diff)
downloadnasm-97a234782d6fa7fa551a27f2ede452f5a56f1745.tar.gz
nasm-97a234782d6fa7fa551a27f2ede452f5a56f1745.tar.bz2
nasm-97a234782d6fa7fa551a27f2ede452f5a56f1745.zip
Switch the preprocessor over to using the hash table library
Switch the preprocessor over to using the hash table library. On my system, this improves the runtime of the output of test/pref/macro.pl from over 600 seconds to 7 seconds. Macros have an odd mix of case-sensitive and case-insensitive behaviour, plus there are matching parameters for arguments, etc. As a result, we use case-insensitive hash tables and use a linked list to store all the possible isomorphs.
Diffstat (limited to 'hashtbl.h')
-rw-r--r--hashtbl.h12
1 files changed, 9 insertions, 3 deletions
diff --git a/hashtbl.h b/hashtbl.h
index cc3daff..a521141 100644
--- a/hashtbl.h
+++ b/hashtbl.h
@@ -31,10 +31,16 @@ struct hash_insert {
};
uint64_t crc64(const char *string);
+uint64_t crc64i(const char *string);
struct hash_table *hash_init(void);
-void *hash_find(struct hash_table *head, const char *string,
+void **hash_find(struct hash_table *head, const char *string,
struct hash_insert *insert);
-void hash_add(struct hash_insert *insert, const char *string, void *data);
-void hash_free(struct hash_table *head, void (*free_func)(char *, void *));
+void **hash_findi(struct hash_table *head, const char *string,
+ struct hash_insert *insert);
+void **hash_add(struct hash_insert *insert, const char *string, void *data);
+void *hash_iterate(const struct hash_table *head,
+ struct hash_tbl_node **iterator,
+ const char **key);
+void hash_free(struct hash_table *head);
#endif /* NASM_HASHTBL_H */