1 #ifndef _UNIFIED_ANNOTATIONS_H_
2 #define _UNIFIED_ANNOTATIONS_H_
5 #include "../../drd/drd.h"
9 * Define annotation macros such that these can be intercepted by DRD, Helgrind
10 * and ThreadSanitizer. See also
11 * http://code.google.com/p/data-race-test/source/browse/trunk/dynamic_annotations/dynamic_annotations.h
13 #define U_ANNOTATE_NEW_MEMORY(addr, size) ANNOTATE_NEW_MEMORY(addr, size)
14 #define U_ANNOTATE_HAPPENS_BEFORE(addr) U_AnnotateHappensBefore(addr)
15 #define U_ANNOTATE_HAPPENS_AFTER(addr) U_AnnotateHappensAfter(addr)
16 #define U_ANNOTATE_HAPPENS_DONE(addr) \
18 ANNOTATE_HAPPENS_DONE(addr); \
30 void __attribute__((weak
,noinline
))
31 AnnotateCondVarSignal(const char *file
, int line
, const volatile void *cv
)
36 void __attribute__((weak
,noinline
))
37 AnnotateCondVarWait(const char *file
, int line
, const volatile void *cv
,
38 const volatile void *lock
)
43 static __inline__
void U_AnnotateHappensBefore(void* addr
)
45 ANNOTATE_HAPPENS_BEFORE(addr
);
46 AnnotateCondVarSignal(__FILE__
, __LINE__
, addr
);
49 static __inline__
void U_AnnotateHappensAfter(void *addr
)
51 ANNOTATE_HAPPENS_AFTER(addr
);
52 AnnotateCondVarWait(__FILE__
, __LINE__
, addr
, NULL
);
64 #endif /* _UNIFIED_ANNOTATIONS_H_ */