forked from OSchip/llvm-project
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. llvm-svn: 301927
This commit is contained in:
parent
7fc481e561
commit
2b66b5a3b7
|
@ -866,9 +866,8 @@ static void MemoryRangeSet(ThreadState *thr, uptr pc, uptr addr, uptr size,
|
|||
// 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)));
|
||||
|
|
Loading…
Reference in New Issue