summaryrefslogtreecommitdiff
path: root/lib/malloca.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-03 20:50:11 +0100
committerJörg Frings-Fürst <debian@jff-webhosting.net>2017-12-03 20:50:11 +0100
commit4cf52fc0bc3b80c0ef6c58c5db4413ebdafe661c (patch)
tree676b26b024117cf656080a011e3d17b8fb6889af /lib/malloca.c
parent1ecbfbb92248e67b564f5b144c4671ccaa86ee2f (diff)
parent44ff3127b1e57b703c2a73a24f7ab38e4aad8ae4 (diff)
Merge branch 'release/0.9.8-1'0.9.8-1
Diffstat (limited to 'lib/malloca.c')
-rw-r--r--lib/malloca.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/malloca.c b/lib/malloca.c
index f1c387f..0e86b1b 100644
--- a/lib/malloca.c
+++ b/lib/malloca.c
@@ -1,5 +1,5 @@
/* Safe automatic memory allocation.
- Copyright (C) 2003, 2006-2007, 2009-2016 Free Software Foundation, Inc.
+ Copyright (C) 2003, 2006-2007, 2009-2017 Free Software Foundation, Inc.
Written by Bruno Haible <bruno@clisp.org>, 2003.
This program is free software: you can redistribute it and/or
@@ -22,7 +22,7 @@
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
- along with this program; if not, see <http://www.gnu.org/licenses/>. */
+ along with this program; if not, see <https://www.gnu.org/licenses/>. */
#define _GL_USE_STDLIB_ALLOC 1
#include <config.h>
@@ -34,6 +34,16 @@
#include "verify.h"
+/* Silence a warning from clang's MemorySanitizer. */
+#if defined __has_feature
+# if __has_feature(memory_sanitizer)
+# define NO_SANITIZE_MEMORY __attribute__((no_sanitize("memory")))
+# endif
+#endif
+#ifndef NO_SANITIZE_MEMORY
+# define NO_SANITIZE_MEMORY
+#endif
+
/* The speed critical point in this file is freea() applied to an alloca()
result: it must be fast, to match the speed of alloca(). The speed of
mmalloca() and freea() in the other case are not critical, because they
@@ -121,7 +131,7 @@ mmalloca (size_t n)
}
#if HAVE_ALLOCA
-void
+void NO_SANITIZE_MEMORY
freea (void *p)
{
/* mmalloca() may have returned NULL. */