From: khizmax Date: Fri, 12 Jun 2015 21:04:20 +0000 (+0300) Subject: Added TSan annotation X-Git-Tag: v2.1.0~204 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=7c9be66f582d11d19ec55a28861d148a56cccb48;p=libcds.git Added TSan annotation --- diff --git a/cds/compiler/feature_tsan.h b/cds/compiler/feature_tsan.h index 1a05a17d..f870ab58 100644 --- a/cds/compiler/feature_tsan.h +++ b/cds/compiler/feature_tsan.h @@ -22,6 +22,7 @@ # define CDS_TSAN_ANNOTATE_IGNORE_RW_END \ CDS_TSAN_ANNOTATE_IGNORE_WRITES_END;\ CDS_TSAN_ANNOTATE_IGNORE_READS_END +# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) AnnotateNewMemory( __FILE__, __LINE__, addr, sz ) // provided by TSan extern "C" { @@ -32,19 +33,24 @@ void AnnotateIgnoreReadsEnd(const char *f, int l); void AnnotateIgnoreWritesBegin(const char *f, int l); void AnnotateIgnoreWritesEnd(const char *f, int l); + + void AnnotateNewMemory(char *f, int l, void * mem, size_t size); + } #else // CDS_THREAD_SANITIZER_ENABLED -# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) -# define CDS_TSAN_ANNOTATE_HAPPENS_AFTER(addr) +# define CDS_TSAN_ANNOTATE_HAPPENS_BEFORE(addr) (void) +# define CDS_TSAN_ANNOTATE_HAPPENS_AFTER(addr) (void) -# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_READS_END -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END -# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN -# define CDS_TSAN_ANNOTATE_IGNORE_RW_END +# define CDS_TSAN_ANNOTATE_IGNORE_READS_BEGIN (void) +# define CDS_TSAN_ANNOTATE_IGNORE_READS_END (void) +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN (void) +# define CDS_TSAN_ANNOTATE_IGNORE_WRITES_END (void) +# define CDS_TSAN_ANNOTATE_IGNORE_RW_BEGIN (void) +# define CDS_TSAN_ANNOTATE_IGNORE_RW_END (void) + +# define CDS_TSAN_ANNOTATE_NEW_MEMORY( addr, sz ) (void) #endif