Index: base/compiler_specific.h |
diff --git a/base/compiler_specific.h b/base/compiler_specific.h |
index 5d7d9d11019bd22bc0a9c9e28f06ccb036566a5e..0d1d9d26e54cc757abdfec0b4a67331b1aa95815 100644 |
--- a/base/compiler_specific.h |
+++ b/base/compiler_specific.h |
@@ -166,4 +166,25 @@ |
// If available, it would look like: |
// __attribute__((format(wprintf, format_param, dots_param))) |
+ |
+// MemorySanitizer annotations. |
+#ifdef MEMORY_SANITIZER |
+extern "C" { |
+ void __msan_unpoison(const void *p, unsigned long s); |
+ void __msan_print_shadow(const void *p, unsigned long s); |
Alexander Potapenko
2013/03/20 11:43:08
Please remove __msan_print_shadow since it's unlik
|
+} |
+ |
+// Mark a memory region fully initialized. |
+// Use this to annotate the code that deliberately reads uninitialized data, |
+// for example a GC scavenging root set pointers from stack. |
+#define MSAN_UNPOISON(p, s) __msan_unpoison(p, s) |
+ |
+// Dump MSan shadow of the memory region to stderr. |
+// MSan shadow is a bitmask with 1's in place of uninitialized bits. |
+#define MSAN_PRINT_SHADOW(p, s) __msan_print_shadow(p, s) |
+#else // MEMORY_SANITIZER |
+#define MSAN_UNPOISON(p, s) |
+#define MSAN_PRINT_SHADOW(p, s) |
+#endif // MEMORY_SANITIZER |
+ |
#endif // BASE_COMPILER_SPECIFIC_H_ |