diff options
Diffstat (limited to 'lib/Support')
-rw-r--r-- | lib/Support/Allocator.cpp | 4 | ||||
-rw-r--r-- | lib/Support/Unix/Program.inc | 5 |
2 files changed, 7 insertions, 2 deletions
diff --git a/lib/Support/Allocator.cpp b/lib/Support/Allocator.cpp index b4fdc1e1bc..e269cf997a 100644 --- a/lib/Support/Allocator.cpp +++ b/lib/Support/Allocator.cpp @@ -104,8 +104,8 @@ void *BumpPtrAllocator::Allocate(size_t Size, size_t Alignment) { if (Ptr + Size <= End) { CurPtr = Ptr + Size; // Update the allocation point of this memory block in MemorySanitizer. - // Without this, MemorySanitizer reports for values originating from it will - // point to the allocation point of the entire slab. + // Without this, MemorySanitizer messages for values originated from here + // will point to the allocation of the entire slab. __msan_allocated_memory(Ptr, Size); return Ptr; } diff --git a/lib/Support/Unix/Program.inc b/lib/Support/Unix/Program.inc index c384316e20..117151c91d 100644 --- a/lib/Support/Unix/Program.inc +++ b/lib/Support/Unix/Program.inc @@ -17,6 +17,7 @@ //===----------------------------------------------------------------------===// #include "Unix.h" +#include "llvm/Support/Compiler.h" #include "llvm/Support/FileSystem.h" #include <llvm/Config/config.h> #if HAVE_SYS_STAT_H @@ -164,12 +165,16 @@ static void SetMemoryLimits (unsigned size) setrlimit (RLIMIT_RSS, &r); #endif #ifdef RLIMIT_AS // e.g. NetBSD doesn't have it. + // Don't set virtual memory limit if built with any Sanitizer. They need 80Tb + // of virtual memory for shadow memory mapping. +#if !LLVM_MEMORY_SANITIZER_BUILD && !LLVM_ADDRESS_SANITIZER_BUILD // Virtual memory. getrlimit (RLIMIT_AS, &r); r.rlim_cur = limit; setrlimit (RLIMIT_AS, &r); #endif #endif +#endif } bool |