+2021-08-07 Bruno Haible <bruno@clisp.org>
+
+ hamt: Improve GCC 11 allocation-deallocation checking.
+ * lib/hamt.h (hamt_free): Move declaration up.
+ (hamt_create, hamt_copy): Declare that deallocation must happen through
+ 'hamt_free'.
+
2021-08-07 Bruno Haible <bruno@clisp.org>
get_progname_of: Improve GCC 11 allocation-deallocation checking.
/* Creation and Destruction */
/****************************/
+/* Free the resources solely allocated by HAMT and all elements solely
+ contained in it. */
+extern void hamt_free (Hamt *hamt);
+
/* Create and return a new and empty hash array mapped trie. */
_GL_ATTRIBUTE_NODISCARD
extern Hamt *hamt_create (Hamt_hasher *hasher, Hamt_comparator *comparator,
- Hamt_freer *freer);
+ Hamt_freer *freer)
+ _GL_ATTRIBUTE_DEALLOC (hamt_free, 1);
/* Return a copy of HAMT, which is not the same in the sense above.
This procedure can be used, for example, so that two threads can
access the same data independently. */
_GL_ATTRIBUTE_NODISCARD
-extern Hamt *hamt_copy (Hamt *hamt);
-
-/* Free the resources solely allocated by HAMT and all elements solely
- contained in it. */
-extern void hamt_free (Hamt *hamt);
+extern Hamt *hamt_copy (Hamt *hamt)
+ _GL_ATTRIBUTE_DEALLOC (hamt_free, 1);
/**********/
/* Lookup */