@@ -64,6 +64,12 @@ void strmap_clear(struct strmap *map, int free_values)
hashmap_clear(&map->map);
}
+void strmap_partial_clear(struct strmap *map, int free_values)
+{
+ strmap_free_entries_(map, free_values);
+ hashmap_partial_clear(&map->map);
+}
+
void *strmap_put(struct strmap *map, const char *str, void *data)
{
struct strmap_entry *entry = find_strmap_entry(map, str);
@@ -42,6 +42,12 @@ void strmap_init_with_options(struct strmap *map,
*/
void strmap_clear(struct strmap *map, int free_values);
+/*
+ * Similar to strmap_clear() but leaves map->map->table allocated and
+ * pre-sized so that subsequent uses won't need as many rehashings.
+ */
+void strmap_partial_clear(struct strmap *map, int free_values);
+
/*
* Insert "str" into the map, pointing to "data".
*