From 8a00fb5b8c1b9c82db5528b288859227a7e35868 Mon Sep 17 00:00:00 2001 From: Xusheng Date: Fri, 8 Nov 2024 13:29:00 +0800 Subject: Bulk add segments in the binary view to improve performance --- view/pe/coffview.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'view/pe/coffview.cpp') diff --git a/view/pe/coffview.cpp b/view/pe/coffview.cpp index 28103a4a..814c8cf2 100644 --- a/view/pe/coffview.cpp +++ b/view/pe/coffview.cpp @@ -246,6 +246,7 @@ bool COFFView::Init() // Read sections reader.Seek(sectionHeadersOffset); BinaryReader sectionNameReader(GetParentView(), LittleEndian); + BeginBulkAddSegments(); for (uint32_t i = 0; i < sectionCount; i++) { @@ -432,6 +433,8 @@ bool COFFView::Init() } } + EndBulkAddSegments(); + // Apply architecture and platform if (!m_arch) { @@ -1214,6 +1217,7 @@ bool COFFView::Init() QualifiedName coffRelocTypeName = DefineType(coffRelocTypeId, coffRelocName, coffRelocStructType); auto relocHandler = m_arch->GetRelocationHandler("COFF"); + BeginBulkAddSegments(); for (uint32_t i = 0; i < sectionCount; i++) { @@ -1351,6 +1355,8 @@ bool COFFView::Init() } } } + + EndBulkAddSegments(); } } catch (std::exception& e) -- cgit v1.3.1