From: khizmax Date: Thu, 7 May 2015 20:18:55 +0000 (+0300) Subject: TSan exam: SkipList X-Git-Tag: v2.1.0~245^2~1 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=763c751dc308158fc606ec0a91a9f3c8f88f0edc;p=libcds.git TSan exam: SkipList --- diff --git a/cds/container/details/skip_list_base.h b/cds/container/details/skip_list_base.h index 609e96b7..ed309c52 100644 --- a/cds/container/details/skip_list_base.h +++ b/cds/container/details/skip_list_base.h @@ -171,18 +171,24 @@ namespace cds { namespace container { template node_type * New( unsigned int nHeight, Q const& v ) { + CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN; unsigned char * pMem = alloc_space( nHeight ); - return new( pMem ) + node_type * p = new( pMem ) node_type( nHeight, nHeight > 1 ? reinterpret_cast(pMem + c_nNodeSize) : nullptr, v ); + CDS_TSAN_ANNOTATE_IGNORE_WRITES_END; + return p; } template node_type * New( unsigned int nHeight, Args&&... args ) { + CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN; unsigned char * pMem = alloc_space( nHeight ); - return new( pMem ) + node_type * p = new( pMem ) node_type( nHeight, nHeight > 1 ? reinterpret_cast(pMem + c_nNodeSize) : nullptr, std::forward(args)... ); + CDS_TSAN_ANNOTATE_IGNORE_WRITES_END; + return p; } void Delete( node_type * p ) @@ -191,7 +197,9 @@ namespace cds { namespace container { unsigned int nHeight = p->height(); node_allocator_type().destroy( p ); + CDS_TSAN_ANNOTATE_IGNORE_WRITES_BEGIN; free_space( reinterpret_cast(p), nHeight ); + CDS_TSAN_ANNOTATE_IGNORE_WRITES_END; } };