Index: third_party/tcmalloc/chromium/src/base/dynamic_annotations.c |
diff --git a/third_party/tcmalloc/chromium/src/base/dynamic_annotations.c b/third_party/tcmalloc/chromium/src/base/dynamic_annotations.c |
index 1005f902f3db784bd6ab73e5a4a12b7faf30b002..c8b61bed2d813a1508371e98c4fff86e6f8f6a0c 100644 |
--- a/third_party/tcmalloc/chromium/src/base/dynamic_annotations.c |
+++ b/third_party/tcmalloc/chromium/src/base/dynamic_annotations.c |
@@ -50,10 +50,19 @@ |
# endif |
#endif |
+/* Compiler-based ThreadSanitizer defines |
+ DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL = 1 |
+ and provides its own definitions of the functions. */ |
+ |
+#ifndef DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL |
+# define DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 0 |
+#endif |
+ |
/* Each function is empty and called (via a macro) only in debug mode. |
The arguments are captured by dynamic tools at runtime. */ |
-#if DYNAMIC_ANNOTATIONS_ENABLED == 1 |
+#if DYNAMIC_ANNOTATIONS_ENABLED == 1 \ |
+ && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 |
void AnnotateRWLockCreate(const char *file, int line, |
const volatile void *lock){} |
@@ -122,7 +131,10 @@ void AnnotateNoOp(const char *file, int line, |
const volatile void *arg){} |
void AnnotateFlushState(const char *file, int line){} |
-#endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 */ |
+#endif /* DYNAMIC_ANNOTATIONS_ENABLED == 1 |
+ && DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 */ |
+ |
+#if DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 |
static int GetRunningOnValgrind(void) { |
#ifdef RUNNING_ON_VALGRIND |
@@ -159,6 +171,8 @@ int RunningOnValgrind(void) { |
return local_running_on_valgrind; |
} |
+#endif /* DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 */ |
+ |
/* See the comments in dynamic_annotations.h */ |
double ValgrindSlowdown(void) { |
/* Same initialization hack as in RunningOnValgrind(). */ |