From 7df4fcada702dbc01d09b8f6fa027f5d409e33e3 Mon Sep 17 00:00:00 2001 From: riperiperi Date: Fri, 5 May 2023 22:40:46 +0100 Subject: GPU: Remove CPU region handle containers (#4817) * GPU: Remove CPU region handle containers. Another one for the "I don't know why I didn't do this earlier" pile. This removes the "Cpu" prefixed region handle classes, which each mirror a region handle type from Ryujinx.Memory. Originally, not all projects had a reference to Ryujinx.Memory, so these classes were introduced to bridge the gap. Someone else crossed that bridge since, so these classes don't have much of a purpose anymore. This PR replaces all uses of CpuRegionHandle etc to their direct Ryujinx.Memory versions. RegionHandle methods (specifically QueryModified) are about the hottest path there is in the entire emulator, so there is a nice boost from doing this. * Add docs --- src/Ryujinx.Memory/Tracking/RegionHandle.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'src/Ryujinx.Memory/Tracking') diff --git a/src/Ryujinx.Memory/Tracking/RegionHandle.cs b/src/Ryujinx.Memory/Tracking/RegionHandle.cs index 7a59f9f2..63a16884 100644 --- a/src/Ryujinx.Memory/Tracking/RegionHandle.cs +++ b/src/Ryujinx.Memory/Tracking/RegionHandle.cs @@ -1,6 +1,7 @@ using System; using System.Collections.Generic; using System.Linq; +using System.Reflection.Metadata; using System.Threading; namespace Ryujinx.Memory.Tracking @@ -443,6 +444,16 @@ namespace Ryujinx.Memory.Tracking return Address < address + size && address < EndAddress; } + /// + /// Determines if this handle's memory range matches another exactly. + /// + /// The other handle + /// True on a match, false otherwise + public bool RangeEquals(RegionHandle other) + { + return RealAddress == other.RealAddress && RealSize == other.RealSize; + } + /// /// Dispose the handle. Within the tracking lock, this removes references from virtual regions. /// -- cgit v1.2.3