Remove the process's reservation cache and don't
bother checking if a region is safe to use. In
cases where regions need to be synthesized rather
than properly allocated, the memory reads required
to determine whether the area is used are
- insufficient, because intermediate locations
could be in use, and
- unsafe, because on some platforms reading from
memory can trigger events.
All this only makes a difference on platforms
where memory allocation in the target is impossible.
Behavior on platforms where it is possible should
stay the same.
<rdar://problem/14023970>
llvm-svn: 185046
diff --git a/lldb/source/Expression/IRMemoryMap.cpp b/lldb/source/Expression/IRMemoryMap.cpp
index e2d4e28..a83da22 100644
--- a/lldb/source/Expression/IRMemoryMap.cpp
+++ b/lldb/source/Expression/IRMemoryMap.cpp
@@ -66,14 +66,6 @@
return ret;
}
- if (process_sp)
- {
- ret = process_sp->GetReservationCache().Find(size);
-
- if (ret != LLDB_INVALID_ADDRESS)
- return ret;
- }
-
for (int iterations = 0; iterations < 16; ++iterations)
{
lldb::addr_t candidate = LLDB_INVALID_ADDRESS;
@@ -101,21 +93,9 @@
if (IntersectsAllocation(candidate, size))
continue;
-
- char buf[1];
-
- Error err;
-
- if (process_sp &&
- (process_sp->ReadMemory(candidate, buf, 1, err) == 1 ||
- process_sp->ReadMemory(candidate + size, buf, 1, err) == 1))
- continue;
-
+
ret = candidate;
-
- if (process_sp)
- process_sp->GetReservationCache().Reserve(candidate, size);
-
+
return ret;
}
@@ -416,8 +396,6 @@
{
if (process_sp->CanJIT() && process_sp->IsAlive())
process_sp->DeallocateMemory(allocation.m_process_alloc); // FindSpace allocated this for real
- else
- process_sp->GetReservationCache().Unreserve(allocation.m_process_alloc); // FindSpace registered this memory
}
break;