mirror of
https://git.743378673.xyz/MeloNX/MeloNX.git
synced 2025-07-24 07:27:10 +02:00
Avoid double lookup on TryGetVirtualContiguous, fix/change some lock usage
This commit is contained in:
parent
942efbb6d6
commit
87ba82691c
4 changed files with 144 additions and 78 deletions
|
@ -473,14 +473,12 @@ namespace Ryujinx.Cpu.Jit
|
|||
|
||||
private bool TryGetVirtualContiguous(ulong va, int size, out MemoryBlock memory, out ulong offset)
|
||||
{
|
||||
if (_addressSpace.HasAnyPrivateAllocation(va, (ulong)size))
|
||||
if (_addressSpace.HasAnyPrivateAllocation(va, (ulong)size, out PrivateRange range))
|
||||
{
|
||||
// If we have a private allocation overlapping the range,
|
||||
// this the access is only considered contiguous if it covers the entire range.
|
||||
|
||||
PrivateRange range = _addressSpace.GetFirstPrivateAllocation(va, (ulong)size, out _);
|
||||
|
||||
if (range.Memory != null && range.Size == (ulong)size)
|
||||
if (range.Memory != null)
|
||||
{
|
||||
memory = range.Memory;
|
||||
offset = range.Offset;
|
||||
|
@ -500,9 +498,6 @@ namespace Ryujinx.Cpu.Jit
|
|||
return IsPhysicalContiguous(va, size);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private bool IsPhysicalContiguousAndMapped(ulong va, int size) => IsPhysicalContiguous(va, size) && IsMapped(va);
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
private bool IsPhysicalContiguous(ulong va, int size)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue