Revert "Workaround Darwin ContainedWithinExistingMap issue"
This reverts commit 29acd2f2e2d5f953535be1f71bc89cbb3a00f52c.
This workaround apparently is not needed in the master branches.
Bug: 16861075
Change-Id: I9aa3e3f8830c81a54bc5ba7fef3b9f87b81cdc4e
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index 0615abd..4d3f8c9 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -130,7 +130,6 @@
uintptr_t MemMap::next_mem_pos_ = GenerateNextMemPos();
#endif
-#if !defined(__APPLE__) // TODO: Reanable after b/16861075 BacktraceMap issue is addressed.
// Return true if the address range is contained in a single /proc/self/map entry.
static bool ContainedWithinExistingMap(uintptr_t begin,
uintptr_t end,
@@ -153,7 +152,6 @@
begin, end, maps.c_str());
return false;
}
-#endif
// Return true if the address range does not conflict with any /proc/self/maps entry.
static bool CheckNonOverlapping(uintptr_t begin,
@@ -388,6 +386,8 @@
std::string* error_msg) {
CHECK_NE(0, prot);
CHECK_NE(0, flags & (MAP_SHARED | MAP_PRIVATE));
+ uintptr_t expected = reinterpret_cast<uintptr_t>(expected_ptr);
+ uintptr_t limit = expected + byte_count;
// Note that we do not allow MAP_FIXED unless reuse == true, i.e we
// expect his mapping to be contained within an existing map.
@@ -396,11 +396,7 @@
// Only use this if you actually made the page reservation yourself.
CHECK(expected_ptr != nullptr);
-#if !defined(__APPLE__) // TODO: Reanable after b/16861075 BacktraceMap issue is addressed.
- uintptr_t expected = reinterpret_cast<uintptr_t>(expected_ptr);
- uintptr_t limit = expected + byte_count;
DCHECK(ContainedWithinExistingMap(expected, limit, error_msg));
-#endif
flags |= MAP_FIXED;
} else {
CHECK_EQ(0, flags & MAP_FIXED);