mirror of
https://github.com/Ryubing/Ryujinx.git
synced 2025-11-30 00:02:23 -05:00
misc: chore: Use collection expressions in Cpu
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Ryujinx.Cpu.LightningJit.Cache
|
||||
}
|
||||
}
|
||||
|
||||
private readonly List<MemoryBlock> _blocks = new();
|
||||
private readonly List<MemoryBlock> _blocks = [];
|
||||
|
||||
public CacheMemoryAllocator(int capacity)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -35,8 +35,8 @@ namespace Ryujinx.Cpu.LightningJit.Cache
|
||||
{
|
||||
_alignedRangeAction = alignedRangeAction;
|
||||
_alignedFunctionAction = alignedFunctionAction;
|
||||
_pendingFunctions = new();
|
||||
_ranges = new();
|
||||
_pendingFunctions = [];
|
||||
_ranges = [];
|
||||
}
|
||||
|
||||
public bool Has(ulong address)
|
||||
|
||||
Reference in New Issue
Block a user