From b3740b8ae0db8e4b1923f90711bb1e9a5eb92ef6 Mon Sep 17 00:00:00 2001 From: khizmax Date: Sat, 13 Jun 2015 00:01:42 +0300 Subject: [PATCH] Added TSan annotations --- cds/memory/michael/allocator.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/cds/memory/michael/allocator.h b/cds/memory/michael/allocator.h index 0366e55a..02711395 100644 --- a/cds/memory/michael/allocator.h +++ b/cds/memory/michael/allocator.h @@ -1223,7 +1223,11 @@ namespace michael { assert( oldAnchor.avail < pDesc->nCapacity ); pAddr = pDesc->pSB + oldAnchor.avail * (unsigned long long) pDesc->nBlockSize; + + // TSan reports data race if the block contained atomic ops before + CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN; newAnchor.avail = reinterpret_cast( pAddr )->nNextFree; + CDS_TSAN_ANNOTATE_IGNORE_WRITES_END; newAnchor.tag += 1; if ( oldActive.credits() == 0 ) { @@ -1686,6 +1690,7 @@ namespace michael { ); } + CDS_TSAN_ANNOTATE_NEW_MEMORY( pBlock + 1, nSize ); return pBlock + 1; } -- 2.34.1