summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-06 03:26:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-06 03:26:34 +0000
commit25336fa7c1db1904c5a4d2eabe03a48e964cd1f8 (patch)
tree85289f52ea86b1e8f2c3eaee05b0a54efb445f7b /internal.h
parent0bd6f36aa73059022fd5dd9cc2462cb4b785ba25 (diff)
* bignum.c (rb_big_realloc): Use VALGRIND_MAKE_MEM_UNDEFINED to
declare undefined memory area. (bignew_1): Ditto. * internal.h (VALGRIND_MAKE_MEM_DEFINED): Moved from gc.c (VALGRIND_MAKE_MEM_UNDEFINED): Ditto. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42392 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index 03acd3f8e1..a4cf43b939 100644
--- a/internal.h
+++ b/internal.h
@@ -19,6 +19,19 @@ extern "C" {
#endif
#endif
+#ifdef HAVE_VALGRIND_MEMCHECK_H
+# include <valgrind/memcheck.h>
+# ifndef VALGRIND_MAKE_MEM_DEFINED
+# define VALGRIND_MAKE_MEM_DEFINED(p, n) VALGRIND_MAKE_READABLE((p), (n))
+# endif
+# ifndef VALGRIND_MAKE_MEM_UNDEFINED
+# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) VALGRIND_MAKE_WRITABLE((p), (n))
+# endif
+#else
+# define VALGRIND_MAKE_MEM_DEFINED(p, n) 0
+# define VALGRIND_MAKE_MEM_UNDEFINED(p, n) 0
+#endif
+
#define numberof(array) ((int)(sizeof(array) / sizeof((array)[0])))
#define STATIC_ASSERT(name, expr) typedef int static_assert_##name##_check[1 - 2*!(expr)]