mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2026-03-21 17:49:58 -05:00
JitRegister: Check IsEnabled before constructing string
Without this, every time we finalize a JIT block, we have to allocate memory for a string and format the string.
This commit is contained in:
parent
89a03199b1
commit
c54dc9db60
|
|
@ -20,6 +20,9 @@ template <typename... Args>
|
|||
inline void Register(const void* base_address, u32 code_size, fmt::format_string<Args...> format,
|
||||
Args&&... args)
|
||||
{
|
||||
if (!IsEnabled())
|
||||
return;
|
||||
|
||||
Register(base_address, code_size, fmt::format(format, std::forward<Args>(args)...));
|
||||
}
|
||||
|
||||
|
|
@ -27,6 +30,9 @@ template <typename... Args>
|
|||
inline void Register(const void* start, const void* end, fmt::format_string<Args...> format,
|
||||
Args&&... args)
|
||||
{
|
||||
if (!IsEnabled())
|
||||
return;
|
||||
|
||||
u32 code_size = (u32)((const char*)end - (const char*)start);
|
||||
Register(start, code_size, fmt::format(format, std::forward<Args>(args)...));
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user