ucx/map.h

changeset 208
262c7be94eba
parent 206
58b77eb51afd
child 209
4f02199d8aae
     1.1 --- a/ucx/map.h	Thu Oct 15 12:39:50 2015 +0200
     1.2 +++ b/ucx/map.h	Thu Oct 15 14:21:38 2015 +0200
     1.3 @@ -146,22 +146,42 @@
     1.4  /**
     1.5   * Frees a hash map.
     1.6   * 
     1.7 - * <b>Note:</b> the contents are <b>not</b> freed, use an UcxMempool for that
     1.8 - * purpose.
     1.9 + * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content()
    1.10 + * before calling this function to achieve that.
    1.11   * 
    1.12   * @param map the map to be freed
    1.13 + * @see ucx_map_free_content()
    1.14   */
    1.15  void ucx_map_free(UcxMap *map);
    1.16  
    1.17  /**
    1.18 + * Frees the contents of a hash map.
    1.19 + * 
    1.20 + * This is a convenience function that iterates over the map and passes all
    1.21 + * values to the standard library free() function.
    1.22 + * 
    1.23 + * You must ensure, that it is valid to pass each value in the map to free().
    1.24 + * 
    1.25 + * You should free or clear the map afterwards, as the contents will be invalid.
    1.26 + * 
    1.27 + * @param map for which the contents shall be freed
    1.28 + * @see ucx_map_free()
    1.29 + * @see ucx_map_clear()
    1.30 + */
    1.31 +void ucx_map_free_content(UcxMap *map);
    1.32 +
    1.33 +/**
    1.34   * Clears a hash map.
    1.35   * 
    1.36 - * <b>Note:</b> the contents are <b>not</b> freed.
    1.37 + * <b>Note:</b> the contents are <b>not</b> freed, use ucx_map_free_content()
    1.38 + * before calling this function to achieve that.
    1.39   * 
    1.40 - * @param map the map to be freed
    1.41 + * @param map the map to be cleared
    1.42 + * @see ucx_map_free_content()
    1.43   */
    1.44  void ucx_map_clear(UcxMap *map);
    1.45  
    1.46 +
    1.47  /**
    1.48   * Copies contents from a map to another map using a copy function.
    1.49   * 

mercurial