]> Savannah Git Hosting - gnulib.git/commitdiff
ino-map: Improve GCC 11 allocation-deallocation checking.
authorBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:47:47 +0000 (19:47 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 7 Aug 2021 17:47:47 +0000 (19:47 +0200)
* lib/ino-map.h (ino_map_free): Move declaration up.
(ino_map_alloc): Declare that deallocation must happen through
'ino_map_free'.

ChangeLog
lib/ino-map.h

index 8daff4879f158a3c4025e7081b8d94b30cd4574f..319f2dd72a805449365876ff6e032d53454df32c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2021-08-07  Bruno Haible  <bruno@clisp.org>
+
+       ino-map: Improve GCC 11 allocation-deallocation checking.
+       * lib/ino-map.h (ino_map_free): Move declaration up.
+       (ino_map_alloc): Declare that deallocation must happen through
+       'ino_map_free'.
+
 2021-08-07  Bruno Haible  <bruno@clisp.org>
 
        hash: Improve GCC 11 allocation-deallocation checking.
index fb820f7d4315e714f35c3cbc8a89ad5b38abac9b..ea40f374eed65dc3311ccfdbfb60529f85c77c38 100644 (file)
 
 # define INO_MAP_INSERT_FAILURE ((size_t) -1)
 
-struct ino_map *ino_map_alloc (size_t);
+struct ino_map;
+
 void ino_map_free (struct ino_map *) _GL_ATTRIBUTE_NONNULL ((1));
+
+struct ino_map *ino_map_alloc (size_t)
+  _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (ino_map_free, 1);
+
 size_t ino_map_insert (struct ino_map *, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
 
 #endif