add comments

This commit is contained in:
LotP1 2025-06-04 00:54:47 +02:00
parent fe5b6ad7c7
commit d7a6f95c8b
2 changed files with 3 additions and 0 deletions

View file

@ -289,6 +289,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
{
RangeItem<BufferModifiedRange>[] overlaps = new RangeItem<BufferModifiedRange>[1];
// We use the non-span method here because keeping the lock will cause a deadlock.
Lock.EnterReadLock();
OverlapResult result = FindOverlapsNonOverlapping(address, size, ref overlaps);
Lock.ExitReadLock();
@ -409,6 +410,7 @@ namespace Ryujinx.Graphics.Gpu.Memory
}
else
{
// We use the non-span method here because the array is partially modified by the code, which would invalidate a span.
rangeCount = FindOverlapsNonOverlapping(address, size, ref overlaps).Count;
}
Lock.ExitReadLock();

View file

@ -299,6 +299,7 @@ namespace Ryujinx.Memory.Tracking
NonOverlappingRangeList<VirtualRegion> regions = guest ? _guestVirtualRegions : _virtualRegions;
ref RangeItem<VirtualRegion>[] overlaps = ref ThreadStaticArray<RangeItem<VirtualRegion>>.Get();
// We use the non-span method here because keeping the lock will cause a deadlock.
regions.Lock.EnterReadLock();
OverlapResult result = regions.FindOverlapsNonOverlapping(address, size, ref overlaps);
regions.Lock.ExitReadLock();