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