84 |
84 |
85 void ucx_map_free_content(UcxMap *map, ucx_destructor destr) { |
85 void ucx_map_free_content(UcxMap *map, ucx_destructor destr) { |
86 UcxMapIterator iter = ucx_map_iterator(map); |
86 UcxMapIterator iter = ucx_map_iterator(map); |
87 void *val; |
87 void *val; |
88 UCX_MAP_FOREACH(key, val, iter) { |
88 UCX_MAP_FOREACH(key, val, iter) { |
89 destr(val); |
89 if (destr) { |
|
90 destr(val); |
|
91 } else { |
|
92 map->allocator->free(val, NULL); |
|
93 } |
90 } |
94 } |
91 } |
95 } |
92 |
96 |
93 void ucx_map_clear(UcxMap *map) { |
97 void ucx_map_clear(UcxMap *map) { |
94 if (map->count == 0) { |
98 if (map->count == 0) { |