From 734747ae5806f85a9378d446d246b7eb27012bb6 Mon Sep 17 00:00:00 2001
From: gdkchan <gab.dark.100@gmail.com>
Date: Mon, 18 Jan 2021 23:31:15 -0300
Subject: [PATCH] Reduce temporary copy/fill buffer size (#1926)

---
 Ryujinx.Memory/IVirtualMemoryManager.cs | 2 +-
 Ryujinx.Memory/MemoryBlock.cs           | 4 ++--
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/Ryujinx.Memory/IVirtualMemoryManager.cs b/Ryujinx.Memory/IVirtualMemoryManager.cs
index cd271a5f94..f52c4b2205 100644
--- a/Ryujinx.Memory/IVirtualMemoryManager.cs
+++ b/Ryujinx.Memory/IVirtualMemoryManager.cs
@@ -15,7 +15,7 @@ namespace Ryujinx.Memory
 
         void Fill(ulong va, ulong size, byte value)
         {
-            const int MaxChunkSize = 1 << 30;
+            const int MaxChunkSize = 1 << 24;
 
             for (ulong subOffset = 0; subOffset < size; subOffset += MaxChunkSize)
             {
diff --git a/Ryujinx.Memory/MemoryBlock.cs b/Ryujinx.Memory/MemoryBlock.cs
index fadd50d44d..3b7a54ae9b 100644
--- a/Ryujinx.Memory/MemoryBlock.cs
+++ b/Ryujinx.Memory/MemoryBlock.cs
@@ -136,7 +136,7 @@ namespace Ryujinx.Memory
         /// <exception cref="InvalidMemoryRegionException">Throw when <paramref name="srcOffset"/>, <paramref name="dstOffset"/> or <paramref name="size"/> is out of range</exception>
         public void Copy(ulong dstOffset, ulong srcOffset, ulong size)
         {
-            const int MaxChunkSize = 1 << 30;
+            const int MaxChunkSize = 1 << 24;
 
             for (ulong offset = 0; offset < size; offset += MaxChunkSize)
             {
@@ -155,7 +155,7 @@ namespace Ryujinx.Memory
         /// <exception cref="InvalidMemoryRegionException">Throw when either <paramref name="offset"/> or <paramref name="size"/> are out of range</exception>
         public void ZeroFill(ulong offset, ulong size)
         {
-            const int MaxChunkSize = 1 << 30;
+            const int MaxChunkSize = 1 << 24;
 
             for (ulong subOffset = 0; subOffset < size; subOffset += MaxChunkSize)
             {