ucx/map.c

changeset 169
08adb4f87160
parent 168
6db9c5d7d7ff
child 255
bf19378aed58
equal deleted inserted replaced
168:6db9c5d7d7ff 169:08adb4f87160
78 78
79 void ucx_map_free(UcxMap *map) { 79 void ucx_map_free(UcxMap *map) {
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 }
84
85 void ucx_map_free_content(UcxMap *map, ucx_destructor destr) {
86 UcxMapIterator iter = ucx_map_iterator(map);
87 void *val;
88 UCX_MAP_FOREACH(key, val, iter) {
89 destr(val);
90 }
83 } 91 }
84 92
85 void ucx_map_clear(UcxMap *map) { 93 void ucx_map_clear(UcxMap *map) {
86 if (map->count == 0) { 94 if (map->count == 0) {
87 return; // nothing to do 95 return; // nothing to do

mercurial