diff options
author | Bruno Haible <bruno@clisp.org> | 2021-08-08 00:00:36 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2021-08-08 00:00:36 +0200 |
commit | daabfceeb13e2a927599ba5cf243d0b94e6687c5 (patch) | |
tree | 22e7921df8f65e0678c451719c76f552a815dba5 /lib/gl_xomap.h | |
parent | 4c424dc470b6ec000c0a10bb649f07358813f842 (diff) | |
download | gnulib-daabfceeb13e2a927599ba5cf243d0b94e6687c5.tar.gz |
list, set, oset, map, omap: Prepare allocation-deallocation checking.
* lib/gl_list.h (gl_list_create_empty, gl_list_nx_create_empty,
gl_list_create, gl_list_nx_create): Add comment that deallocation must
happen through 'gl_list_free'.
* lib/gl_xlist.h (gl_list_create_empty, gl_list_create): Likewise.
* lib/gl_sublist.h (gl_sublist_create, gl_sublist_nx_create): Likewise.
* lib/gl_xsublist.h (gl_sublist_create): Likewise.
* lib/gl_set.h (gl_set_create_empty, gl_set_nx_create_empty): Add
comment that deallocation must happen through 'gl_set_free'.
* lib/gl_xset.h (gl_set_create_empty): Likewise.
* lib/gl_oset.h (gl_oset_create_empty, gl_oset_nx_create_empty): Add
comment that deallocation must happen through 'gl_oset_free'.
* lib/gl_xoset.h (gl_oset_create_empty): Likewise.
* lib/gl_map.h (gl_map_create_empty, gl_map_nx_create_empty): Add
comment that deallocation must happen through 'gl_map_free'.
* lib/gl_xmap.h (gl_map_create_empty): Likewise.
* lib/gl_omap.h (gl_omap_create_empty, gl_omap_nx_create_empty): Add
comment that deallocation must happen through 'gl_omap_free'.
* lib/gl_xomap.h (gl_omap_create_empty): Likewise.
Diffstat (limited to 'lib/gl_xomap.h')
-rw-r--r-- | lib/gl_xomap.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/gl_xomap.h b/lib/gl_xomap.h index a74ac6da4f..bc21528a65 100644 --- a/lib/gl_xomap.h +++ b/lib/gl_xomap.h @@ -41,13 +41,18 @@ extern "C" { extern gl_omap_t gl_omap_create_empty (gl_omap_implementation_t implementation, gl_mapkey_compar_fn compar_fn, gl_mapkey_dispose_fn kdispose_fn, - gl_mapvalue_dispose_fn vdispose_fn); + gl_mapvalue_dispose_fn vdispose_fn) + /*_GL_ATTRIBUTE_DEALLOC (gl_omap_free, 1)*/ + _GL_ATTRIBUTE_RETURNS_NONNULL; extern bool gl_omap_put (gl_omap_t map, const void *key, const void *value); extern bool gl_omap_getput (gl_omap_t map, const void *key, const void *value, const void **oldvaluep); #endif -GL_XOMAP_INLINE gl_omap_t +GL_XOMAP_INLINE +/*_GL_ATTRIBUTE_DEALLOC (gl_omap_free, 1)*/ +_GL_ATTRIBUTE_RETURNS_NONNULL +gl_omap_t gl_omap_create_empty (gl_omap_implementation_t implementation, gl_mapkey_compar_fn compar_fn, gl_mapkey_dispose_fn kdispose_fn, |