summaryrefslogtreecommitdiff
path: root/Source/Core
diff options
context:
space:
mode:
authorJosJuice <josjuice@gmail.com>2026-01-11 20:17:37 +0100
committerJosJuice <josjuice@gmail.com>2026-01-11 21:01:49 +0100
commitc54dc9db60051fe8e8cd70b3ae69e07aa9a2a471 (patch)
tree72b911c3a4b839a2bde276ce64029c99a5231863 /Source/Core
parent89a03199b14cb32b715096df7bea93ffb39bad51 (diff)
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.
Diffstat (limited to 'Source/Core')
-rw-r--r--Source/Core/Common/JitRegister.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/Source/Core/Common/JitRegister.h b/Source/Core/Common/JitRegister.h
index 41f020a2f6..b54a0c2df6 100644
--- a/Source/Core/Common/JitRegister.h
+++ b/Source/Core/Common/JitRegister.h
@@ -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)...));
}