ucx/map.c

changeset 209
4f02199d8aae
parent 208
262c7be94eba
child 225
a1a068c2c4ef
equal deleted inserted replaced
208:262c7be94eba 209:4f02199d8aae
80 ucx_map_free_elmlist_contents(map); 80 ucx_map_free_elmlist_contents(map);
81 alfree(map->allocator, map->map); 81 alfree(map->allocator, map->map);
82 alfree(map->allocator, map); 82 alfree(map->allocator, map);
83 } 83 }
84 84
85 void ucx_map_free_content(UcxMap *map) { 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 free(val); 89 destr(val);
90 } 90 }
91 } 91 }
92 92
93 void ucx_map_clear(UcxMap *map) { 93 void ucx_map_clear(UcxMap *map) {
94 if (map->count == 0) { 94 if (map->count == 0) {

mercurial