21 #define __has_feature(x) 0 28 #ifndef DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 29 # define DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL 0 35 #if DYNAMIC_ANNOTATIONS_EXTERNAL_IMPL == 0 && !defined(__native_client__) 37 #if __has_feature(memory_sanitizer) 38 #include <sanitizer/msan_interface.h> 46 const volatile void *){}
48 const volatile void *){}
50 const volatile void *,
long){}
52 const volatile void *,
long){}
54 const volatile void *,
57 const volatile void *,
68 const volatile void *mem,
size_t size) {
69 #if __has_feature(memory_sanitizer) 70 __msan_unpoison(mem, size);
78 const volatile void *mem,
size_t size) {
79 #if __has_feature(memory_sanitizer) 80 __msan_allocated_memory(mem, size);
88 #ifdef RUNNING_ON_VALGRIND 89 if (RUNNING_ON_VALGRIND)
return 1;
91 char *running_on_valgrind_str = getenv(
"RUNNING_ON_VALGRIND");
92 if (running_on_valgrind_str) {
93 return strcmp(running_on_valgrind_str,
"0") != 0;
100 static volatile int running_on_valgrind = -1;
101 int local_running_on_valgrind = running_on_valgrind;
105 if (local_running_on_valgrind == -1)
107 return local_running_on_valgrind;
113 static volatile double slowdown = 0.0;
114 double local_slowdown = slowdown;
119 if (local_slowdown == 0.0) {
120 char *env = getenv(
"VALGRIND_SLOWDOWN");
121 slowdown = local_slowdown = env ? atof(env) : 50.0;
123 return local_slowdown;
void AnnotateIgnoreWritesBegin(const char *, int)
void AnnotateRWLockReleased(const char *, int, const volatile void *, long)
#define ANNOTATE_BENIGN_RACE(address, description)
static int GetRunningOnValgrind(void)
void AnnotateIgnoreReadsEnd(const char *, int)
void AnnotateIgnoreWritesEnd(const char *, int)
void AnnotateThreadName(const char *, int, const char *)
void AnnotateBenignRaceSized(const char *, int, const volatile void *, size_t, const char *)
void AnnotateBenignRace(const char *, int, const volatile void *, const char *)
double ValgrindSlowdown(void)
void AnnotateMemoryIsInitialized(const char *, int, const volatile void *mem, size_t size)
void AnnotateMemoryIsUninitialized(const char *, int, const volatile void *mem, size_t size)
void AnnotateEnableRaceDetection(const char *, int, int)
void AnnotateIgnoreReadsBegin(const char *, int)
void AnnotateRWLockAcquired(const char *, int, const volatile void *, long)
int RunningOnValgrind(void)
void AnnotateRWLockDestroy(const char *, int, const volatile void *)
void AnnotateRWLockCreate(const char *, int, const volatile void *)