From 7898b35d683484e7e7b4449e1f308794137675fd Mon Sep 17 00:00:00 2001 From: Petr Hosek Date: Wed, 11 Oct 2017 19:29:14 +0000 Subject: 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 --- lib/sanitizer_common/sanitizer_win.cc | 37 ----------------------------------- 1 file changed, 37 deletions(-) (limited to 'lib/sanitizer_common/sanitizer_win.cc') diff --git a/lib/sanitizer_common/sanitizer_win.cc b/lib/sanitizer_common/sanitizer_win.cc index 762ba46cc..f1a74d3f2 100644 --- a/lib/sanitizer_common/sanitizer_win.cc +++ b/lib/sanitizer_common/sanitizer_win.cc @@ -235,31 +235,6 @@ void *MmapFixedOrDie(uptr fixed_addr, uptr size) { return p; } -// Uses fixed_addr for now. -// Will use offset instead once we've implemented this function for real. -uptr ReservedAddressRange::Map(uptr fixed_addr, uptr size, - bool tolerate_enomem) { - if (tolerate_enomem) { - return reinterpret_cast(MmapFixedOrDieOnFatalError(fixed_addr, size)); - } - return reinterpret_cast(MmapFixedOrDie(uptr fixed_addr, uptr size)); -} - -void ReservedAddressRange::Unmap(uptr addr, uptr size) { - void* addr_as_void = reinterpret_cast(addr); - uptr base_as_uptr = reinterpret_cast(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(addr), size); - if (addr_as_void == base_) { - base_ = reinterpret_cast(addr + size); - } - size_ = size_ - size; -} - void *MmapFixedOrDieOnFatalError(uptr fixed_addr, uptr size) { void *p = VirtualAlloc((LPVOID)fixed_addr, size, MEM_COMMIT, PAGE_READWRITE); @@ -277,18 +252,6 @@ void *MmapNoReserveOrDie(uptr size, const char *mem_type) { return MmapOrDie(size, mem_type); } -uptr ReservedAddressRange::Init(uptr size, const char *name, uptr fixed_addr) { - if (fixed_addr) { - base_ = MmapFixedNoAccess(fixed_addr, size, name); - } else { - base_ = MmapNoAccess(size); - } - size_ = size; - name_ = name; - return reinterpret_cast(base_); -} - - void *MmapFixedNoAccess(uptr fixed_addr, uptr size, const char *name) { (void)name; // unsupported void *res = VirtualAlloc((LPVOID)fixed_addr, size, -- cgit v1.2.3