diff options
author | H. Peter Anvin <hpa@zytor.com> | 2017-04-24 00:41:21 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2017-04-24 00:54:51 -0700 |
commit | bbb39579ec340aba9cda4c7033dd934b620423ea (patch) | |
tree | 94a5e00fc63672d2ec15feab825e3c295bfe4111 /include/hashtbl.h | |
parent | bf0bcef3d4975ab964d573fecbe2a8b2960b8120 (diff) | |
download | nasm-bbb39579ec340aba9cda4c7033dd934b620423ea.tar.gz |
hashtbl, strtbl: add hash_free_all(), split strtbl_find()
Add hash_free_all() to factor common code of iterating over all
members of a hash to free them with a single nasm_free().
Split strtbl_find() into strtbl_find() and strtbl_add(). It is very
unlikely that the same call site will want to have both of these
functionalities, and in the end the code for the two functions are
surprisingly different.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'include/hashtbl.h')
-rw-r--r-- | include/hashtbl.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/hashtbl.h b/include/hashtbl.h index da618c8a..25f2d2d5 100644 --- a/include/hashtbl.h +++ b/include/hashtbl.h @@ -81,5 +81,6 @@ void *hash_iterate(const struct hash_table *head, struct hash_tbl_node **iterator, const char **key); void hash_free(struct hash_table *head); +void hash_free_all(struct hash_table *head, bool free_keys); #endif /* NASM_HASHTBL_H */ |