[Lldb-commits] [PATCH] D55522: Cache memory regions in ProcessMinidump and use the linux maps as the source of the information if available.

Tatyana Krasnukha via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Mon Dec 10 11:20:22 PST 2018


tatyana-krasnukha added a comment.

Without overriding Process::GetMemoryRegions still does a lot of unnecessary job (FindMemoryRegion for each element in the vector).
With these changes, it may just return m_regions (if not empty), doesn't it?



================
Comment at: source/Plugins/Process/minidump/MinidumpParser.cpp:475
           static_cast<uint32_t>(MinidumpMemoryInfoState::MemFree);
-      info.SetMapped((entry->state != MemFree) ? yes : no);
 
+  for (const auto &entry : mem_info_list) {
----------------
Here may be `m_regions.reserve(mem_info_list.size())` 


================
Comment at: source/Plugins/Process/minidump/MinidumpParser.cpp:484
+    region.SetMapped((entry->state != MemFree) ? yes : no);
+    m_regions.push_back(region);
+  }
----------------
You can move `region`  here.


================
Comment at: source/Plugins/Process/minidump/MinidumpParser.cpp:500
+    return false;
+    
+  for (const auto &memory_desc : memory_list) {
----------------
m_regions.reserve(memory_list.size()) and m_regions.shrink_to_fit() after the loop.


================
Comment at: source/Plugins/Process/minidump/MinidumpParser.cpp:526
+    return false;
+    
+  for (const auto &memory_desc : memory64_list) {
----------------
Same


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D55522/new/

https://reviews.llvm.org/D55522





More information about the lldb-commits mailing list