From 855161b23b8d2d99893c5cb5f0f7c874b9978f2f Mon Sep 17 00:00:00 2001 From: FluffyOMC <45863583+FluffyOMC@users.noreply.github.com> Date: Fri, 14 Feb 2025 22:37:19 -0500 Subject: [PATCH] Prevent log from showing negative JIT cache sizes (32bit-int overflow) (#664) ![image](https://github.com/user-attachments/assets/5820ce7b-cbfe-4908-8f5e-7ee82040ee1a) --- src/ARMeilleure/Translation/Cache/JitCache.cs | 2 +- src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs | 2 +- src/Ryujinx/Assets/locales.json | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/ARMeilleure/Translation/Cache/JitCache.cs b/src/ARMeilleure/Translation/Cache/JitCache.cs index bc75e7d3f..5871b5308 100644 --- a/src/ARMeilleure/Translation/Cache/JitCache.cs +++ b/src/ARMeilleure/Translation/Cache/JitCache.cs @@ -186,7 +186,7 @@ namespace ARMeilleure.Translation.Cache int newRegionNumber = _activeRegionIndex; - Logger.Warning?.Print(LogClass.Cpu, $"JIT Cache Region {exhaustedRegion} exhausted, creating new Cache Region {newRegionNumber} ({((newRegionNumber + 1) * CacheSize).Bytes()} Total Allocation)."); + Logger.Warning?.Print(LogClass.Cpu, $"JIT Cache Region {exhaustedRegion} exhausted, creating new Cache Region {newRegionNumber} ({((long)(newRegionNumber + 1) * CacheSize).Bytes()} Total Allocation)."); _cacheAllocator = new CacheMemoryAllocator(CacheSize); diff --git a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs index ccf8ad964..1d79ed0b5 100644 --- a/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs +++ b/src/Ryujinx.Cpu/LightningJit/Cache/JitCache.cs @@ -166,7 +166,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache int newRegionNumber = _activeRegionIndex; - Logger.Warning?.Print(LogClass.Cpu, $"JIT Cache Region {exhaustedRegion} exhausted, creating new Cache Region {newRegionNumber} ({((newRegionNumber + 1) * CacheSize).Bytes()} Total Allocation)."); + Logger.Warning?.Print(LogClass.Cpu, $"JIT Cache Region {exhaustedRegion} exhausted, creating new Cache Region {newRegionNumber} ({((long)(newRegionNumber + 1) * CacheSize).Bytes()} Total Allocation)."); _cacheAllocator = new CacheMemoryAllocator(CacheSize); diff --git a/src/Ryujinx/Assets/locales.json b/src/Ryujinx/Assets/locales.json index 684051368..c6f474577 100644 --- a/src/Ryujinx/Assets/locales.json +++ b/src/Ryujinx/Assets/locales.json @@ -4621,7 +4621,7 @@ "zh_CN": "繁体中文(推荐)", "zh_TW": "正體中文 (建議)" } - }, + }, { "ID": "SettingsTabSystemSystemLanguageSwedish", "Translations": { @@ -4646,7 +4646,7 @@ "zh_CN": "瑞典语", "zh_TW": "" } - }, + }, { "ID": "SettingsTabSystemSystemLanguageNorwegian", "Translations": { @@ -24073,4 +24073,4 @@ } } ] -} +} \ No newline at end of file