[Lldb-commits] [PATCH] D55472: Speadup memory regions handling and cleanup related code
Tatyana Krasnukha via Phabricator via lldb-commits
lldb-commits at lists.llvm.org
Fri Dec 7 22:52:08 PST 2018
tatyana-krasnukha created this revision.
tatyana-krasnukha added a reviewer: clayborg.
tatyana-krasnukha added a project: LLDB.
Herald added subscribers: lldb-commits, abidh.
- replace unnecessary shared pointers with unique pointers
- reserve space before filling a vector with 'push_back' in a loop to avoid muptiple allocations and memory fragmentation (except Process::GetMemoryRegions, it is not possible to know the size in advance here)
- override GetMemoryRegions for the ProcessMinidump:
Process::GetMemoryRegions fills the list of regions by calling GetMemoryRegionInfo until it returns an error. But ProcessMinidump implementation GetMemoryRegionInfo parses whole list every time and searches requested range there. Now GetMemoryRegions does this work just once.
- use move semantic where it is possible (and desirable)
- fix size_t -> uint32_t truncation
- add missing constness
I had to change API slightly, but believe these changes doesn't break existing code that uses this API.
Profiling a sipmle program I got nice results - execution of GetMemoryRegions function took just 0.01% of total time against 0.17% for unchanged version.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 16952 bytes
Desc: not available
More information about the lldb-commits