diff options
author | Kostya Serebryany <kcc@google.com> | 2012-11-23 14:46:25 +0000 |
---|---|---|
committer | Kostya Serebryany <kcc@gcc.gnu.org> | 2012-11-23 14:46:25 +0000 |
commit | e297eb600dd52acd73fb64ca45905b68f4e9b99b (patch) | |
tree | a354102cd1c27b09eefe0b04f517d4ecac5bc566 /libsanitizer/tsan/tsan_defs.h | |
parent | 8ddf5c28ea6be09213739c94f9765019be476bb0 (diff) | |
download | gcc-e297eb600dd52acd73fb64ca45905b68f4e9b99b.tar.gz |
[libsanitizer] merge from upstream r168514
From-SVN: r193756
Diffstat (limited to 'libsanitizer/tsan/tsan_defs.h')
-rw-r--r-- | libsanitizer/tsan/tsan_defs.h | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/libsanitizer/tsan/tsan_defs.h b/libsanitizer/tsan/tsan_defs.h index 6a6f6b97832..6f3fd21e246 100644 --- a/libsanitizer/tsan/tsan_defs.h +++ b/libsanitizer/tsan/tsan_defs.h @@ -22,6 +22,12 @@ namespace __tsan { +#ifdef TSAN_GO +const char *const kTsanOptionsEnv = "GORACE"; +#else +const char *const kTsanOptionsEnv = "TSAN_OPTIONS"; +#endif + const int kTidBits = 13; const unsigned kMaxTid = 1 << kTidBits; const unsigned kMaxTidInClock = kMaxTid * 2; // This includes msb 'freed' bit. @@ -34,20 +40,23 @@ const int kTraceStackSize = 256; #ifdef TSAN_SHADOW_COUNT # if TSAN_SHADOW_COUNT == 2 \ || TSAN_SHADOW_COUNT == 4 || TSAN_SHADOW_COUNT == 8 -const unsigned kShadowCnt = TSAN_SHADOW_COUNT; +const uptr kShadowCnt = TSAN_SHADOW_COUNT; # else # error "TSAN_SHADOW_COUNT must be one of 2,4,8" # endif #else // Count of shadow values in a shadow cell. -const unsigned kShadowCnt = 8; +const uptr kShadowCnt = 4; #endif // That many user bytes are mapped onto a single shadow cell. -const unsigned kShadowCell = 8; +const uptr kShadowCell = 8; // Size of a single shadow value (u64). -const unsigned kShadowSize = 8; +const uptr kShadowSize = 8; + +// Shadow memory is kShadowMultiplier times larger than user memory. +const uptr kShadowMultiplier = kShadowSize * kShadowCnt / kShadowCell; #if defined(TSAN_COLLECT_STATS) && TSAN_COLLECT_STATS const bool kCollectStats = true; |