Skip to content

Commit

Permalink
stacktrace: Add unlikely macro for performance
Browse files Browse the repository at this point in the history
Add unlikely macro for performance

Signed-off-by: Bojun Seo <[email protected]>
  • Loading branch information
Bojun-Seo authored and honggyukim committed Jan 2, 2023
1 parent 8037cd5 commit d07529d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions stacktrace.cc
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@ void release_backtrace(void* addr)
pr_dbg(" release_backtrace(%p)\n", addr);

const auto& addrit = addrmap.find(addr);
if (addrit == addrmap.end())
if (unlikely(addrit == addrmap.end()))
return;

object_info_t& object_info = addrit->second;
stack_trace_t& stack_trace = object_info.stack_trace;

const auto& stackit = stackmap.find(stack_trace);
if (stackit == stackmap.end())
if (unlikely(stackit == stackmap.end()))
return;

stack_info_t& stack_info = stackit->second;
Expand Down

0 comments on commit d07529d

Please sign in to comment.