ucx/map.h

changeset 208
262c7be94eba
parent 206
58b77eb51afd
child 209
4f02199d8aae
equal deleted inserted replaced
207:1de85ecf6adc 208:262c7be94eba
144 UcxMap *ucx_map_new_a(UcxAllocator *allocator, size_t size); 144 UcxMap *ucx_map_new_a(UcxAllocator *allocator, size_t size);
145 145
146 /** 146 /**
147 * Frees a hash map. 147 * Frees a hash map.
148 * 148 *
149 * <b>Note:</b> the contents are <b>not</b> freed, use an UcxMempool for that 149 * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content()
150 * purpose. 150 * before calling this function to achieve that.
151 * 151 *
152 * @param map the map to be freed 152 * @param map the map to be freed
153 * @see ucx_map_free_content()
153 */ 154 */
154 void ucx_map_free(UcxMap *map); 155 void ucx_map_free(UcxMap *map);
155 156
156 /** 157 /**
158 * Frees the contents of a hash map.
159 *
160 * This is a convenience function that iterates over the map and passes all
161 * values to the standard library free() function.
162 *
163 * You must ensure, that it is valid to pass each value in the map to free().
164 *
165 * You should free or clear the map afterwards, as the contents will be invalid.
166 *
167 * @param map for which the contents shall be freed
168 * @see ucx_map_free()
169 * @see ucx_map_clear()
170 */
171 void ucx_map_free_content(UcxMap *map);
172
173 /**
157 * Clears a hash map. 174 * Clears a hash map.
158 * 175 *
159 * <b>Note:</b> the contents are <b>not</b> freed. 176 * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content()
160 * 177 * before calling this function to achieve that.
161 * @param map the map to be freed 178 *
179 * @param map the map to be cleared
180 * @see ucx_map_free_content()
162 */ 181 */
163 void ucx_map_clear(UcxMap *map); 182 void ucx_map_clear(UcxMap *map);
183
164 184
165 /** 185 /**
166 * Copies contents from a map to another map using a copy function. 186 * Copies contents from a map to another map using a copy function.
167 * 187 *
168 * <b>Note:</b> The destination map does not need to be empty. However, if it 188 * <b>Note:</b> The destination map does not need to be empty. However, if it

mercurial