1 //===-- sanitizer_mac_libcdep.cc ------------------------------------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // This file is shared between various sanitizers' runtime libraries and
11 // implements OSX-specific functions.
12 //===----------------------------------------------------------------------===//
14 #include "sanitizer_platform.h"
16 #include "sanitizer_mac.h"
20 namespace __sanitizer {
22 void RestrictMemoryToMaxAddress(uptr max_address) {
23 uptr size_to_mmap = GetMaxVirtualAddress() + 1 - max_address;
24 void *res = MmapFixedNoAccess(max_address, size_to_mmap, "high gap");
25 CHECK(res != MAP_FAILED);
28 } // namespace __sanitizer
30 #endif // SANITIZER_MAC