From 7c9be66f582d11d19ec55a28861d148a56cccb48 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 13 Jun 2015 00:04:20 +0300 Subject: [PATCH] Added TSan annotation --- cds/compiler/feature_tsan.h | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) 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 -- 2.34.1