aboutsummaryrefslogtreecommitdiff
path: root/src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs')
-rw-r--r--src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs b/src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs
index d64ed309..fc075a26 100644
--- a/src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs
+++ b/src/Ryujinx.Graphics.Device/DeviceMemoryManager.cs
@@ -1,5 +1,7 @@
+using Ryujinx.Common.Memory;
using Ryujinx.Memory;
using System;
+using System.Buffers;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
@@ -143,11 +145,11 @@ namespace Ryujinx.Graphics.Device
}
else
{
- Memory<byte> memory = new byte[size];
+ IMemoryOwner<byte> memoryOwner = ByteMemoryPool.Rent(size);
- GetSpan(va, size).CopyTo(memory.Span);
+ GetSpan(va, size).CopyTo(memoryOwner.Memory.Span);
- return new WritableRegion(this, va, memory, tracked: true);
+ return new WritableRegion(this, va, memoryOwner, tracked: true);
}
}