1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 15:07:45 +00:00

LibELF + LibDebug: Reduce allocations during symbolification

Avoid promotion of static strings to AK::String, instead use
AK::StringView and operator ""sv, to force string view's instead
which avoids allocation of String. This code path isn't hot enough
that it makes a huge difference, but every bit counts.
This commit is contained in:
Brian Gianforcaro 2021-05-30 23:44:02 -07:00 committed by Ali Mohammad Pur
parent 35a97884aa
commit 5bfba3f789
5 changed files with 12 additions and 12 deletions

View file

@ -17,7 +17,7 @@ namespace Debug {
DebugInfo::DebugInfo(NonnullOwnPtr<const ELF::Image> elf, String source_root, FlatPtr base_address)
: m_elf(move(elf))
, m_source_root(source_root)
, m_source_root(move(source_root))
, m_base_address(base_address)
, m_dwarf_info(*m_elf)
{
@ -78,7 +78,7 @@ void DebugInfo::parse_scopes_impl(const Dwarf::DIE& die)
void DebugInfo::prepare_lines()
{
auto section = elf().lookup_section(".debug_line");
auto section = elf().lookup_section(".debug_line"sv);
if (!section.has_value())
return;