summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan Liew <dan@su-root.co.uk>2018-07-20 17:07:35 +0000
committerDan Liew <dan@su-root.co.uk>2018-07-20 17:07:35 +0000
commit517b6132810b6ceb8ea6d45174d8986e1b023461 (patch)
treecb682580c8ad7b19f18586f2fe2344fd472794d6 /lib
parent4f6d4b8d42668e3b665636f8a0e8a3e2cec32483 (diff)
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 git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@337579 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/sanitizer_common/sanitizer_mac.cc8
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/sanitizer_common/sanitizer_mac.cc b/lib/sanitizer_common/sanitizer_mac.cc
index c613a6af1..180d7c199 100644
--- a/lib/sanitizer_common/sanitizer_mac.cc
+++ b/lib/sanitizer_common/sanitizer_mac.cc
@@ -102,9 +102,15 @@ extern "C" void *__mmap(void *addr, size_t len, int prot, int flags, int fildes,
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);
}