summaryrefslogtreecommitdiff
path: root/lib/gl_xlist.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-08-08 00:00:36 +0200
committerBruno Haible <bruno@clisp.org>2021-08-08 00:00:36 +0200
commitdaabfceeb13e2a927599ba5cf243d0b94e6687c5 (patch)
tree22e7921df8f65e0678c451719c76f552a815dba5 /lib/gl_xlist.h
parent4c424dc470b6ec000c0a10bb649f07358813f842 (diff)
downloadgnulib-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_xlist.h')
-rw-r--r--lib/gl_xlist.h18
1 files changed, 14 insertions, 4 deletions
diff --git a/lib/gl_xlist.h b/lib/gl_xlist.h
index 87fd6ea528..7e66ab2505 100644
--- a/lib/gl_xlist.h
+++ b/lib/gl_xlist.h
@@ -41,13 +41,17 @@ extern gl_list_t gl_list_create_empty (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
gl_listelement_dispose_fn dispose_fn,
- bool allow_duplicates);
+ bool allow_duplicates)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
extern gl_list_t gl_list_create (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
gl_listelement_dispose_fn dispose_fn,
bool allow_duplicates,
- size_t count, const void **contents);
+ size_t count, const void **contents)
+ /*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+ _GL_ATTRIBUTE_RETURNS_NONNULL;
extern void gl_list_node_set_value (gl_list_t list, gl_list_node_t node,
const void *elt);
extern gl_list_node_t gl_list_set_at (gl_list_t list, size_t position,
@@ -67,7 +71,10 @@ extern gl_list_node_t gl_sortedlist_add (gl_list_t list,
const void *elt);
#endif
-GL_XLIST_INLINE gl_list_t
+GL_XLIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_list_t
gl_list_create_empty (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,
@@ -82,7 +89,10 @@ gl_list_create_empty (gl_list_implementation_t implementation,
return result;
}
-GL_XLIST_INLINE gl_list_t
+GL_XLIST_INLINE
+/*_GL_ATTRIBUTE_DEALLOC (gl_list_free, 1)*/
+_GL_ATTRIBUTE_RETURNS_NONNULL
+gl_list_t
gl_list_create (gl_list_implementation_t implementation,
gl_listelement_equals_fn equals_fn,
gl_listelement_hashcode_fn hashcode_fn,