diff options
author | Petr Hosek <phosek@chromium.org> | 2017-10-11 19:29:14 +0000 |
---|---|---|
committer | Petr Hosek <phosek@chromium.org> | 2017-10-11 19:29:14 +0000 |
commit | 7898b35d683484e7e7b4449e1f308794137675fd (patch) | |
tree | ffcdd56212d46c610d2a12e1bb4eb899aabed020 /lib/sanitizer_common/sanitizer_fuchsia.cc | |
parent | c37be534a252a7cb8e2ab04b15256232394dd7a9 (diff) |
Revert "[sanitizer] Introduce ReservedAddressRange to sanitizer_common"
This reverts commit r315493 which is failing to build on sanitizer-windows.
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@315494 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/sanitizer_common/sanitizer_fuchsia.cc')
-rw-r--r-- | lib/sanitizer_common/sanitizer_fuchsia.cc | 31 |
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/sanitizer_common/sanitizer_fuchsia.cc b/lib/sanitizer_common/sanitizer_fuchsia.cc index 00a8aabbf..21fabddb1 100644 --- a/lib/sanitizer_common/sanitizer_fuchsia.cc +++ b/lib/sanitizer_common/sanitizer_fuchsia.cc @@ -236,37 +236,6 @@ void *MmapOrDieOnFatalError(uptr size, const char *mem_type) { return DoAnonymousMmapOrDie(size, mem_type, false, false); } -uptr ReservedAddressRange::Init(uptr init_size, const char* name = nullptr, - uptr fixed_addr = uptr(0)) { - base_ = MmapNoAccess(init_size); - size_ = size; - name_ = name; - return reinterpret_cast<uptr>(base_); -} - -// Uses fixed_addr for now. -// Will use offset instead once we've implemented this function for real. -uptr ReservedAddressRange::Map(uptr fixed_addr, uptr map_size, - bool tolerate_enomem = true) { - return reinterpret_cast<uptr>(MmapFixedOrDie(fixed_addr, size, - tolerate_enomem)); -} - -void ReservedAddressRange::Unmap(uptr addr, uptr size) { - void* addr_as_void = reinterpret_cast<void*>(addr); - uptr base_as_uptr = reinterpret_cast<uptr>(base_); - // Only unmap at the beginning or end of the range. - CHECK_EQ((addr_as_void == base_) || (addr + size == base_as_uptr + size_), - true); - // Detect overflows. - CHECK_LE(size, (base_as_uptr + size_) - addr); - UnmapOrDie(reinterpret_cast<void*>(addr), size); - if (addr_as_void == base_) { - base_ = reinterpret_cast<void*>(addr + size); - } - size_ = size_ - size; -} - // MmapNoAccess and MmapFixedOrDie are used only by sanitizer_allocator. // Instead of doing exactly what they say, we make MmapNoAccess actually // just allocate a VMAR to reserve the address space. Then MmapFixedOrDie |