diff options
author | H. Peter Anvin <hpa@zytor.com> | 2007-09-16 17:57:25 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2007-09-16 18:04:57 -0700 |
commit | 97a234782d6fa7fa551a27f2ede452f5a56f1745 (patch) | |
tree | e937544cbdb0ac1368b587df71b94d3169726207 /hashtbl.h | |
parent | d2fb7a699ea8eb953313eead23180986a424271e (diff) | |
download | nasm-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.h | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -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 */ |