Add some missing comments
Change-Id: I5ff393dfe082559887e9beed1fdb359035c5d3aa
diff --git a/runtime/mem_map.cc b/runtime/mem_map.cc
index 90cc189..2d3581d 100644
--- a/runtime/mem_map.cc
+++ b/runtime/mem_map.cc
@@ -134,14 +134,17 @@
uintptr_t MemMap::next_mem_pos_ = GenerateNextMemPos();
#endif
-// Return true if the address range is contained in a single /proc/self/map entry.
+// Return true if the address range is contained in a single memory map by either reading
+// the maps_ variable or the /proc/self/map entry.
bool MemMap::ContainedWithinExistingMap(uint8_t* ptr, size_t size, std::string* error_msg) {
uintptr_t begin = reinterpret_cast<uintptr_t>(ptr);
uintptr_t end = begin + size;
+ // There is a suspicion that BacktraceMap::Create is occasionally missing maps. TODO: Investigate
+ // further.
{
MutexLock mu(Thread::Current(), *Locks::mem_maps_lock_);
- for (auto& pair : *MemMap::maps_) {
+ for (auto& pair : *maps_) {
MemMap* const map = pair.second;
if (begin >= reinterpret_cast<uintptr_t>(map->Begin()) &&
end <= reinterpret_cast<uintptr_t>(map->End())) {
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index daaa195..6cbbce9 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -127,7 +127,7 @@
bool reserved_location = false;
// Manager may be null if we are running without a runtime.
if (!success && kUseDlopenOnHost && manager != nullptr) {
- // ReserveOatFileLocation returns false if we are not the first caller to register that
+ // RegisterOatFileLocation returns false if we are not the first caller to register that
// location.
reserved_location = manager->RegisterOatFileLocation(location);
success = reserved_location;