misc: chore: Use collection expressions in Cpu

This commit is contained in:
Evan Husted
2025-01-26 15:41:05 -06:00
parent ed2590a8ac
commit 3e12865f51
26 changed files with 934 additions and 931 deletions

View File

@@ -24,7 +24,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
}
}
private readonly List<MemoryBlock> _blocks = new();
private readonly List<MemoryBlock> _blocks = [];
public CacheMemoryAllocator(int capacity)
{

View File

@@ -22,7 +22,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
private static CacheMemoryAllocator _cacheAllocator;
private static readonly List<CacheEntry> _cacheEntries = new();
private static readonly List<CacheEntry> _cacheEntries = [];
private static readonly Lock _lock = new();
private static bool _initialized;

View File

@@ -6,8 +6,8 @@ namespace Ryujinx.Cpu.LightningJit.Cache
{
class JitCacheInvalidation
{
private static readonly int[] _invalidationCode = new int[]
{
private static readonly int[] _invalidationCode =
[
unchecked((int)0xd53b0022), // mrs x2, ctr_el0
unchecked((int)0xd3504c44), // ubfx x4, x2, #16, #4
unchecked((int)0x52800083), // mov w3, #0x4
@@ -35,8 +35,8 @@ namespace Ryujinx.Cpu.LightningJit.Cache
unchecked((int)0x54ffffa8), // b.hi 54 <ic_clear_loop>
unchecked((int)0xd5033b9f), // dsb ish
unchecked((int)0xd5033fdf), // isb
unchecked((int)0xd65f03c0), // ret
};
unchecked((int)0xd65f03c0) // ret
];
private delegate void InvalidateCache(ulong start, ulong end);

View File

@@ -231,7 +231,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
_sharedCache.Pointer,
SharedCacheSize);
List<(ulong, ThreadLocalCacheEntry)> toDelete = new();
List<(ulong, ThreadLocalCacheEntry)> toDelete = [];
foreach ((ulong address, ThreadLocalCacheEntry entry) in _threadLocalCache)
{

View File

@@ -35,8 +35,8 @@ namespace Ryujinx.Cpu.LightningJit.Cache
{
_alignedRangeAction = alignedRangeAction;
_alignedFunctionAction = alignedFunctionAction;
_pendingFunctions = new();
_ranges = new();
_pendingFunctions = [];
_ranges = [];
}
public bool Has(ulong address)