summaryrefslogtreecommitdiff
path: root/lib/fstrcmp.h
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2020-02-16 13:49:49 +0100
committerBruno Haible <bruno@clisp.org>2020-02-16 13:49:49 +0100
commitb5ba60c50b5c0e510e06d5f8137a922ba4895b17 (patch)
tree1e6c4d049b6b072ef8f9b39341f7955f7f99c709 /lib/fstrcmp.h
parent03d7a6b1fa91b8a22b3b335ee8e70536e4dd65e4 (diff)
downloadgnulib-b5ba60c50b5c0e510e06d5f8137a922ba4895b17.tar.gz
fstrcmp: Add API to clean up resources.
Reported by Akim Demaille <akim@lrde.epita.fr> in <https://lists.gnu.org/archive/html/bug-gnulib/2020-01/msg00080.html>. * lib/fstrcmp.h (fstrcmp_free_resources): New declaration. * lib/fstrcmp.c (fstrcmp_free_resources): New function.
Diffstat (limited to 'lib/fstrcmp.h')
-rw-r--r--lib/fstrcmp.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/fstrcmp.h b/lib/fstrcmp.h
index 92b67e34a3..37df588a3e 100644
--- a/lib/fstrcmp.h
+++ b/lib/fstrcmp.h
@@ -38,6 +38,15 @@ extern double fstrcmp_bounded (const char *s1, const char *s2,
/* A shortcut for fstrcmp. Avoids a function call. */
#define fstrcmp(s1,s2) fstrcmp_bounded (s1, s2, 0.0)
+/* Frees the per-thread resources allocated by this module for the current
+ thread.
+ You don't need to call this function in threads other than the main thread,
+ because per-thread resources are reclaimed automatically when the thread
+ exits. However, per-thread resources allocated by the main thread are
+ comparable to static allocations; calling this function can be useful to
+ avoid an error report from valgrind. */
+extern void fstrcmp_free_resources (void);
+
#ifdef __cplusplus
}
#endif