[compiler-rt] r301927 - tsan: allow fast large MemoryRangeSet on non-Windows Go
Dmitry Vyukov via llvm-commits
llvm-commits at lists.llvm.org
Tue May 2 08:15:46 PDT 2017
Author: dvyukov
Date: Tue May 2 10:15:45 2017
New Revision: 301927
URL: http://llvm.org/viewvc/llvm-project?rev=301927&view=rev
Log:
tsan: allow fast large MemoryRangeSet on non-Windows Go
The fast reset for large memory regions is not working
only on windows. So enable it for Go/linux/darwin/freebsd.
See https://github.com/golang/go/issues/20139
for background and motivation.
Based on idea by Josh Bleecher Snyder.
Modified:
compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
Modified: compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc?rev=301927&r1=301926&r2=301927&view=diff
==============================================================================
--- compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc (original)
+++ compiler-rt/trunk/lib/tsan/rtl/tsan_rtl.cc Tue May 2 10:15:45 2017
@@ -866,9 +866,8 @@ static void MemoryRangeSet(ThreadState *
// Don't want to touch lots of shadow memory.
// If a program maps 10MB stack, there is no need reset the whole range.
size = (size + (kShadowCell - 1)) & ~(kShadowCell - 1);
- // UnmapOrDie/MmapFixedNoReserve does not work on Windows,
- // so we do it only for C/C++.
- if (SANITIZER_GO || size < common_flags()->clear_shadow_mmap_threshold) {
+ // UnmapOrDie/MmapFixedNoReserve does not work on Windows.
+ if (SANITIZER_WINDOWS || size < common_flags()->clear_shadow_mmap_threshold) {
u64 *p = (u64*)MemToShadow(addr);
CHECK(IsShadowMem((uptr)p));
CHECK(IsShadowMem((uptr)(p + size * kShadowCnt / kShadowCell - 1)));
More information about the llvm-commits
mailing list