From 9405768cfb16bae71330a244d8025279abdac1ab Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Sat, 7 Aug 2021 19:47:47 +0200 Subject: [PATCH] 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'. --- ChangeLog | 7 +++++++ lib/ino-map.h | 7 ++++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 8daff4879f..319f2dd72a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2021-08-07 Bruno Haible + + 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 hash: Improve GCC 11 allocation-deallocation checking. diff --git a/lib/ino-map.h b/lib/ino-map.h index fb820f7d43..ea40f374ee 100644 --- a/lib/ino-map.h +++ b/lib/ino-map.h @@ -23,8 +23,13 @@ # 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 -- 2.39.5