[compiler-rt] r337579 - On Darwin switch from the `VM_MEMORY_ANALYSIS_TOOL` VM tag to

Dan Liew via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 20 10:07:36 PDT 2018


Author: delcypher
Date: Fri Jul 20 10:07:35 2018
New Revision: 337579

URL: http://llvm.org/viewvc/llvm-project?rev=337579&view=rev
Log:
On Darwin switch from the `VM_MEMORY_ANALYSIS_TOOL` VM tag to
`VM_MEMORY_SANITIZER`.

It turns out that `VM_MEMORY_ANALYSIS_TOOL` is already reserved for
use by other tools so switch to a tag reserved for use by the Sanitizers.

rdar://problem/41969783

Differential Revision: https://reviews.llvm.org/D49603

Modified:
    compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc

Modified: compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc?rev=337579&r1=337578&r2=337579&view=diff
==============================================================================
--- compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc (original)
+++ compiler-rt/trunk/lib/sanitizer_common/sanitizer_mac.cc Fri Jul 20 10:07:35 2018
@@ -102,9 +102,15 @@ extern "C" void *__mmap(void *addr, size
 extern "C" int __munmap(void *, size_t) SANITIZER_WEAK_ATTRIBUTE;
 
 // ---------------------- sanitizer_libc.h
+
+// From <mach/vm_statistics.h>, but not on older OSs.
+#ifndef VM_MEMORY_SANITIZER
+#define VM_MEMORY_SANITIZER 99
+#endif
+
 uptr internal_mmap(void *addr, size_t length, int prot, int flags,
                    int fd, u64 offset) {
-  if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_ANALYSIS_TOOL);
+  if (fd == -1) fd = VM_MAKE_TAG(VM_MEMORY_SANITIZER);
   if (&__mmap) return (uptr)__mmap(addr, length, prot, flags, fd, offset);
   return (uptr)mmap(addr, length, prot, flags, fd, offset);
 }




More information about the llvm-commits mailing list