From f9ed8f860e42e6e126a454912a3facd3ea78cd44 Mon Sep 17 00:00:00 2001
From: Gabriel A <gab.dark.100@gmail.com>
Date: Tue, 26 Dec 2023 23:23:10 -0300
Subject: [PATCH] Fix assert

---
 src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs
index 0a78d7a5f..a71074995 100644
--- a/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs
+++ b/src/Ryujinx.Cpu/LightningJit/Cache/NoWxCache.cs
@@ -11,7 +11,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
     {
         private const int CodeAlignment = 4; // Bytes.
         private const int SharedCacheSize = 2047 * 1024 * 1024;
-        private const int LocalCacheSize = 256 * 1024 * 1024;
+        private const int LocalCacheSize = 128 * 1024 * 1024;
 
         // How many calls to the same function we allow until we pad the shared cache to force the function to become available there
         // and allow the guest to take the fast path.
@@ -149,7 +149,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
 
             lock (_lock)
             {
-                if (!_pendingMap.Has(guestAddress))
+                if (!_pendingMap.Has(guestAddress) && !_translator.Functions.ContainsKey(guestAddress))
                 {
                     int funcOffset = _sharedCache.Allocate(code.Length);