]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Merge patch from JeremyF:
authorJulian Seward <jseward@acm.org>
Sat, 16 Nov 2002 11:06:50 +0000 (11:06 +0000)
committerJulian Seward <jseward@acm.org>
Sat, 16 Nov 2002 11:06:50 +0000 (11:06 +0000)
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

include/valgrind.h

index 789d65d4944b724fde1043c6eb903f3f7a95cf88..dad18ee6503bcd0dc9dbf05b3da02819cf7386c8 100644 (file)
@@ -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
                  : "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