* lib/memchr.valgrind: New file.
* lib/memchr2.valgrind: New file.
* modules/memchr (Files): Distribute valgrind file.
* modules/memchr2 (Files): Likewise.
Signed-off-by: Eric Blake <ebb9@byu.net>
2009-06-15 Eric Blake <ebb9@byu.net>
+ memchr, memchr2: add valgrind exception
+ * lib/memchr.valgrind: New file.
+ * lib/memchr2.valgrind: New file.
+ * modules/memchr (Files): Distribute valgrind file.
+ * modules/memchr2 (Files): Likewise.
+
docs: memchr is no longer obsolete
* MODULES.html.sh: Move memchr from obsolete to string.h section.
* lib/string.in.h (memchr): Simplify logic.
--- /dev/null
+# Suppress a valgrind message about use of uninitialized memory in memchr().
+# POSIX states that when the character is found, memchr must not read extra
+# bytes in an overestimated length (for example, where memchr is used to
+# implement strnlen). However, we use a safe word read to provide a speedup.
+{
+ memchr-value4
+ Memcheck:Value4
+ fun:rpl_memchr
+}
+{
+ memchr-value8
+ Memcheck:Value8
+ fun:rpl_memchr
+}
--- /dev/null
+# Suppress a valgrind message about use of uninitialized memory in memchr2().
+# Like memchr, it is safe to overestimate the length when the terminator
+# is guaranteed to be found. In this case, we may end up reading a word
+# that is partially uninitialized, but this use is OK for a speedup.
+{
+ memchr2-value4
+ Memcheck:Value4
+ fun:memchr2
+}
+{
+ memchr2-value8
+ Memcheck:Value8
+ fun:memchr2
+}
Files:
lib/memchr.c
+lib/memchr.valgrind
m4/memchr.m4
m4/mmap-anon.m4
Files:
lib/memchr2.h
lib/memchr2.c
+lib/memchr2.valgrind
Depends-on:
stdint