Merge branch 'en/hashmap-clear-fix'
hashmap API clean-up to ensure hashmap_clear() leaves a cleared map in a reusable state. * en/hashmap-clear-fix: hashmap: ensure hashmaps are reusable after hashmap_clear()maint
commit
4a4656d083
|
|
@ -205,8 +205,9 @@ void hashmap_clear_(struct hashmap *map, ssize_t entry_offset)
|
||||||
return;
|
return;
|
||||||
if (entry_offset >= 0) /* called by hashmap_clear_and_free */
|
if (entry_offset >= 0) /* called by hashmap_clear_and_free */
|
||||||
free_individual_entries(map, entry_offset);
|
free_individual_entries(map, entry_offset);
|
||||||
free(map->table);
|
FREE_AND_NULL(map->table);
|
||||||
memset(map, 0, sizeof(*map));
|
map->tablesize = 0;
|
||||||
|
map->private_size = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
struct hashmap_entry *hashmap_get(const struct hashmap *map,
|
struct hashmap_entry *hashmap_get(const struct hashmap *map,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue