aboutsummaryrefslogtreecommitdiff
path: root/include/valgrind.h
diff options
context:
space:
mode:
authorsewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2002-11-16 11:06:50 +0000
committersewardj <sewardj@a5019735-40e9-0310-863c-91ae7b9d1cf9>2002-11-16 11:06:50 +0000
commit37091fb739760631f436043c47de612cf9fd2dd1 (patch)
tree6a67f572736b5be4629fc778538bb147250b0a35 /include/valgrind.h
parent2a68e7e696822d9290c2c406246fb01431213463 (diff)
downloadvalgrind-37091fb739760631f436043c47de612cf9fd2dd1.tar.gz
Merge patch from JeremyF:
27-nvalgrind Make valgrind.h pay attention to the preprocessor symbol NVALGRIND. If defined, it compiles out the Valgrind magic sequence and just assigns the result with the default return. This is analogous to NDEBUG's effect on assert(). git-svn-id: svn://svn.valgrind.org/valgrind/trunk@1320 a5019735-40e9-0310-863c-91ae7b9d1cf9
Diffstat (limited to 'include/valgrind.h')
-rw-r--r--include/valgrind.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/valgrind.h b/include/valgrind.h
index 789d65d49..dad18ee65 100644
--- a/include/valgrind.h
+++ b/include/valgrind.h
@@ -76,6 +76,7 @@
+#ifndef NVALGRIND
/* This defines the magic code sequence which the JITter spots and
handles magically. Don't look too closely at this; it will rot
your brain. Valgrind dumps the result value in %EDX, so we first
@@ -111,7 +112,22 @@
: "eax", "edx", "cc", "memory" \
); \
}
-
+#else /* NVALGRIND */
+/* Define NVALGRIND to completely remove the Valgrind magic sequence
+ from the compiled code (analogous to NDEBUG's effects on
+ assert()) */
+#define VALGRIND_MAGIC_SEQUENCE( \
+ _zzq_rlval, /* result lvalue */ \
+ _zzq_default, /* result returned when running on real CPU */ \
+ _zzq_request, /* request code */ \
+ _zzq_arg1, /* request first param */ \
+ _zzq_arg2, /* request second param */ \
+ _zzq_arg3, /* request third param */ \
+ _zzq_arg4 /* request fourth param */ ) \
+ { \
+ (_zzq_rlval) = (_zzq_default); \
+ }
+#endif /* NVALGRIND */
/* Some request codes. There are many more of these, but most are not
exposed to end-user view. These are the public ones, all of the