From c54dc9db60051fe8e8cd70b3ae69e07aa9a2a471 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sun, 11 Jan 2026 20:17:37 +0100 Subject: [PATCH] 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. --- Source/Core/Common/JitRegister.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Source/Core/Common/JitRegister.h b/Source/Core/Common/JitRegister.h index 41f020a2f6d..b54a0c2df6b 100644 --- a/Source/Core/Common/JitRegister.h +++ b/Source/Core/Common/JitRegister.h @@ -20,6 +20,9 @@ template inline void Register(const void* base_address, u32 code_size, fmt::format_string format, Args&&... args) { + if (!IsEnabled()) + return; + Register(base_address, code_size, fmt::format(format, std::forward(args)...)); } @@ -27,6 +30,9 @@ template inline void Register(const void* start, const void* end, fmt::format_string 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)...)); }