From f6e83e64abbf76bbfddc90f885f7c3be379ecf2c Mon Sep 17 00:00:00 2001 From: Katharina Fey Date: Sun, 14 Jul 2019 18:41:07 +0100 Subject: Various improvements around HASH nodes The example previously would lead to corrupt memory when running for items that needed to re-hash the hash array. This has been fixed. Secondly, all HASH node memory leaks are now fixed, that resulted from badly tracking objects through the resize process. A new function `hash_free_shallow` was added to help with this. The function `array_free_shallow` is unused but might become useful in the future and so was not removed. The hash strategy is still garbage but this can be fixed later :) --- hash.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'hash.h') diff --git a/hash.h b/hash.h index a5d763d..369d849 100644 --- a/hash.h +++ b/hash.h @@ -7,5 +7,9 @@ err_t hash_insert_key(struct bowl *, char *key, struct bowl *); err_t hash_remove_key(struct bowl *, char *key, struct bowl **); +err_t hash_free(struct bowl *); + +err_t hash_free_shallow(struct bowl_arr *); + #endif // HASH_H_ -- cgit v1.2.3