aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs')
-rw-r--r--src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs b/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs
index eb665c2d..06c11b7b 100644
--- a/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs
+++ b/src/Ryujinx.Cpu/Jit/JitMemoryAllocator.cs
@@ -5,7 +5,14 @@ namespace Ryujinx.Cpu.Jit
{
public class JitMemoryAllocator : IJitMemoryAllocator
{
+ private readonly MemoryAllocationFlags _jitFlag;
+
+ public JitMemoryAllocator(bool forJit = false)
+ {
+ _jitFlag = forJit ? MemoryAllocationFlags.Jit : MemoryAllocationFlags.None;
+ }
+
public IJitMemoryBlock Allocate(ulong size) => new JitMemoryBlock(size, MemoryAllocationFlags.None);
- public IJitMemoryBlock Reserve(ulong size) => new JitMemoryBlock(size, MemoryAllocationFlags.Reserve | MemoryAllocationFlags.Jit);
+ public IJitMemoryBlock Reserve(ulong size) => new JitMemoryBlock(size, MemoryAllocationFlags.Reserve | _jitFlag);
}
}