invert order of BgColorFn calls in mem edit to avoid cache misses
BgColorFn(addr) will call find_section(addr) internally. If we call BgColorFn(addr + 1) and then BgColorFn(addr), the first call may cause the cached `last_pinfo` / `last_other_root_obj` to change to the next one in the list, which in turn will cause the second call to "page fault". Inverting the order doesn't change anything in mem_edit but it better uses our application cache to speedup section finding.
This commit is contained in:
parent
aef07b24f9
commit
47c993dd01
1 changed files with 1 additions and 1 deletions
2
third_party/imgui_club/imgui_memory_editor.h
vendored
2
third_party/imgui_club/imgui_memory_editor.h
vendored
|
@ -321,8 +321,8 @@ struct MemoryEditor
|
||||||
}
|
}
|
||||||
else if (BgColorFn != nullptr)
|
else if (BgColorFn != nullptr)
|
||||||
{
|
{
|
||||||
is_next_byte_highlighted = (addr + 1 < mem_size) && ((BgColorFn(mem_data, addr + 1, UserData) & IM_COL32_A_MASK) != 0);
|
|
||||||
bg_color = BgColorFn(mem_data, addr, UserData);
|
bg_color = BgColorFn(mem_data, addr, UserData);
|
||||||
|
is_next_byte_highlighted = (addr + 1 < mem_size) && ((BgColorFn(mem_data, addr + 1, UserData) & IM_COL32_A_MASK) != 0);
|
||||||
}
|
}
|
||||||
if (bg_color != 0)
|
if (bg_color != 0)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue