summaryrefslogtreecommitdiff
path: root/view/macho/machoview.cpp
diff options
context:
space:
mode:
authorXusheng <xusheng@vector35.com>2024-11-08 13:29:00 +0800
committerXusheng <xusheng@vector35.com>2024-11-13 18:45:59 +0800
commit8a00fb5b8c1b9c82db5528b288859227a7e35868 (patch)
tree8d240dcd729437064c0c9d254cde37dc2229dd07 /view/macho/machoview.cpp
parent30a0fbb5839b08dc58efe602a5cd19c90fbd4c50 (diff)
Bulk add segments in the binary view to improve performance
Diffstat (limited to 'view/macho/machoview.cpp')
-rw-r--r--view/macho/machoview.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/view/macho/machoview.cpp b/view/macho/machoview.cpp
index 5a118256..d26769e1 100644
--- a/view/macho/machoview.cpp
+++ b/view/macho/machoview.cpp
@@ -1593,6 +1593,7 @@ bool MachoView::InitializeHeader(MachOHeader& header, bool isMainHeader, uint64_
if (!(m_header.ident.filetype == MH_FILESET && isMainHeader)) \
{
+ BeginBulkAddSegments();
for (auto &segment: header.segments) {
if ((segment.initprot == MACHO_VM_PROT_NONE) || (!segment.vmsize))
continue;
@@ -1619,6 +1620,8 @@ bool MachoView::InitializeHeader(MachOHeader& header, bool isMainHeader, uint64_
AddAutoSegment(segment.vmaddr, segment.vmsize, segment.fileoff, segment.filesize, flags);
}
+ EndBulkAddSegments();
+
for (auto& section : header.sections)
{
char sectionName[17];