hashtable_destroy()

This commit is contained in:
Matheus
2022-07-29 20:57:08 -03:00
parent f8d0c13520
commit 0fcb602574
2 changed files with 10 additions and 0 deletions
+1
View File
@@ -18,6 +18,7 @@ typedef struct{
bool hashtable_init(hashtable*, size_t);
bool hashtable_insert(hashtable*, char*, void*);
bool hashtable_remove(hashtable*, char*);
void hashtable_destroy(hashtable*);
void* hashtable_get(hashtable*, char*);
#endif
+9
View File
@@ -112,3 +112,12 @@ void* hashtable_get(hashtable* table, char* key){
return entry->val;
}
void hashtable_destroy(hashtable* table){
// would be cool if this also deleted non removed entries
free(table->entries);
}