[llvm-commits] [compiler-rt] r162018 - in /compiler-rt/trunk/lib/tsan/rtl: tsan_platform.h tsan_rtl.h
Dmitry Vyukov
dvyukov at google.com
Thu Aug 16 06:27:26 PDT 2012
Author: dvyukov
Date: Thu Aug 16 08:27:25 2012
New Revision: 162018
URL: http://llvm.org/viewvc/llvm-project?rev=162018&view=rev
Log:
tsan: fix COMPAT shadow mapping for new memory allocator
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h?rev=162018&r1=162017&r2=162018&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_platform.h Thu Aug 16 08:27:25 2012
@@ -28,7 +28,7 @@
// when memory addresses are of the 0x2axxxxxxxxxx form.
// The option is enabled with 'setarch x86_64 -L'.
#elif defined(TSAN_COMPAT_SHADOW) && TSAN_COMPAT_SHADOW
-static const uptr kLinuxAppMemBeg = 0x2a0000000000ULL;
+static const uptr kLinuxAppMemBeg = 0x290000000000ULL;
static const uptr kLinuxAppMemEnd = 0x7fffffffffffULL;
#else
static const uptr kLinuxAppMemBeg = 0x7cf000000000ULL;
@@ -62,9 +62,6 @@
CHECK(IsShadowMem(shadow));
#ifdef TSAN_GO
return (shadow & ~kLinuxShadowMsk) / kShadowCnt;
-#elif defined(TSAN_COMPAT_SHADOW) && TSAN_COMPAT_SHADOW
- // COMPAT mapping is not quite one-to-one.
- return (shadow / kShadowCnt) | 0x280000000000ULL;
#else
return (shadow / kShadowCnt) | kLinuxAppMemMsk;
#endif
@@ -72,9 +69,10 @@
// For COMPAT mapping returns an alternative address
// that mapped to the same shadow address.
+// COMPAT mapping is not quite one-to-one.
static inline uptr AlternativeAddress(uptr addr) {
#if defined(TSAN_COMPAT_SHADOW) && TSAN_COMPAT_SHADOW
- return addr | kLinuxAppMemMsk;
+ return addr | 0x280000000000ULL;
#else
return 0;
#endif
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h?rev=162018&r1=162017&r2=162018&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.h Thu Aug 16 08:27:25 2012
@@ -47,7 +47,7 @@
#ifndef TSAN_GO
#if defined(TSAN_COMPAT_SHADOW) && TSAN_COMPAT_SHADOW
-const uptr kAllocatorSpace = 0x7e0000000000ULL;
+const uptr kAllocatorSpace = 0x7d0000000000ULL;
#else
const uptr kAllocatorSpace = 0x7d0000000000ULL;
#endif
More information about the llvm-commits
mailing list