From f79520a90601e20c887055761cd6c7ab0463f329 Mon Sep 17 00:00:00 2001 From: mitaclaw <140017135+mitaclaw@users.noreply.github.com> Date: Tue, 23 Apr 2024 09:28:49 -0700 Subject: Cached Interpreter 2.0 It now supports variable-sized data payloads and memory range freeing. It's a little faster, too. --- Source/Core/Common/CodeBlock.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'Source/Core/Common/CodeBlock.h') diff --git a/Source/Core/Common/CodeBlock.h b/Source/Core/Common/CodeBlock.h index 9efc82edeb..8c6291dc63 100644 --- a/Source/Core/Common/CodeBlock.h +++ b/Source/Core/Common/CodeBlock.h @@ -17,7 +17,7 @@ namespace Common // having to prefix them with gen-> or something similar. // Example implementation: // class JIT : public CodeBlock {} -template +template class CodeBlock : public T { private: @@ -53,7 +53,10 @@ public: { region_size = size; total_region_size = size; - region = static_cast(Common::AllocateExecutableMemory(total_region_size)); + if constexpr (executable) + region = static_cast(Common::AllocateExecutableMemory(total_region_size)); + else + region = static_cast(Common::AllocateMemoryPages(total_region_size)); T::SetCodePtr(region, region + size); } -- cgit v1.2.3