[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
di-set: Improve GCC 11 allocation-deallocation checking
From: |
Bruno Haible |
Subject: |
di-set: Improve GCC 11 allocation-deallocation checking |
Date: |
Sat, 07 Aug 2021 19:30:47 +0200 |
User-agent: |
KMail/5.1.3 (Linux/4.4.0-210-generic; KDE/5.18.0; x86_64; ; ) |
2021-08-07 Bruno Haible <bruno@clisp.org>
di-set: Improve GCC 11 allocation-deallocation checking.
* lib/di-set.h (di_set_free): Move declaration up.
(di_set_alloc): Declare that deallocation must happen through
'di_set_free'.
diff --git a/lib/di-set.h b/lib/di-set.h
index ae380d3..30c81ed 100644
--- a/lib/di-set.h
+++ b/lib/di-set.h
@@ -21,9 +21,15 @@
# include <sys/types.h>
-struct di_set *di_set_alloc (void);
-int di_set_insert (struct di_set *, dev_t, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
+struct di_set;
+
void di_set_free (struct di_set *) _GL_ATTRIBUTE_NONNULL ((1));
+
+struct di_set *di_set_alloc (void)
+ _GL_ATTRIBUTE_MALLOC _GL_ATTRIBUTE_DEALLOC (di_set_free, 1);
+
+int di_set_insert (struct di_set *, dev_t, ino_t) _GL_ATTRIBUTE_NONNULL ((1));
+
int di_set_lookup (struct di_set *dis, dev_t dev, ino_t ino)
_GL_ATTRIBUTE_NONNULL ((1));
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- di-set: Improve GCC 11 allocation-deallocation checking,
Bruno Haible <=