LibDebug: Avoid short lived allocations in DIE::for_each_child

This algorithm is both iterative and recursive, so allocating on every
recursion, or when iterating each child is extremely costly.

Instead allow the on stack DIE to be re-initialized so it can be reused.
This commit is contained in:
Brian Gianforcaro 2021-09-17 02:12:29 -07:00 committed by Andreas Kling
commit 952441943f
Notes: sideshowbarker 2024-07-18 03:43:00 +09:00
2 changed files with 17 additions and 12 deletions

View file

@ -36,6 +36,7 @@ public:
Optional<u32> parent_offset() const { return m_parent_offset; }
private:
void rehydrate_from(u32 offset, Optional<u32> parent_offset);
CompilationUnit const& m_compilation_unit;
u32 m_offset { 0 };
u32 m_data_offset { 0 };