mirror of
https://git.naxdy.org/Mirror/Ryujinx.git
synced 2025-12-16 12:09:51 +00:00
experimental caching of memory array
This commit is contained in:
parent
caefa53949
commit
27620161c2
@ -263,6 +263,9 @@ namespace Ryujinx.Cpu.Jit
|
||||
}
|
||||
}
|
||||
|
||||
//Might cause issues, if so revert to old solution
|
||||
byte[] _cachedArray = [];
|
||||
|
||||
public override ReadOnlySpan<byte> GetSpan(ulong va, int size, bool tracked = false)
|
||||
{
|
||||
if (size == 0)
|
||||
@ -281,7 +284,12 @@ namespace Ryujinx.Cpu.Jit
|
||||
}
|
||||
else
|
||||
{
|
||||
Span<byte> data = new byte[size];
|
||||
if (_cachedArray.Length < size)
|
||||
{
|
||||
Array.Resize(ref _cachedArray, size);
|
||||
}
|
||||
|
||||
Span<byte> data = _cachedArray.AsSpan(0, size);
|
||||
|
||||
Read(va, data);
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user