From e51ccf206b916dc061c71346b7f5ee5ffc5d1fdf Mon Sep 17 00:00:00 2001 From: ReinUsesLisp Date: Sun, 29 Jul 2018 01:39:15 -0300 Subject: [PATCH] Cache changes (#302) * Skip repeated cache tests between same sync * Skip some checks for regions where just one resource is resident * Dehardcode residency page size * Some cleanup --- Memory/AMemory.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Memory/AMemory.cs b/Memory/AMemory.cs index 054277b..e969cca 100644 --- a/Memory/AMemory.cs +++ b/Memory/AMemory.cs @@ -160,23 +160,23 @@ namespace ChocolArm64.Memory return HostPageSize; } - public bool[] IsRegionModified(long Position, long Size) + public (bool[], long) IsRegionModified(long Position, long Size) { if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows)) { - return null; + return (null, 0); } long EndPos = Position + Size; if ((ulong)EndPos < (ulong)Position) { - return null; + return (null, 0); } if ((ulong)EndPos > AMemoryMgr.RamSize) { - return null; + return (null, 0); } IntPtr MemAddress = new IntPtr(RamPtr + Position); @@ -201,7 +201,7 @@ namespace ChocolArm64.Memory Modified[(VA - Position) / HostPageSize] = true; } - return Modified; + return (Modified, Count); } public IntPtr GetHostAddress(long Position, long Size)