aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Memory/WindowsShared
diff options
context:
space:
mode:
Diffstat (limited to 'Ryujinx.Memory/WindowsShared')
-rw-r--r--Ryujinx.Memory/WindowsShared/EmulatedSharedMemoryWindows.cs13
-rw-r--r--Ryujinx.Memory/WindowsShared/PlaceholderList.cs12
2 files changed, 16 insertions, 9 deletions
diff --git a/Ryujinx.Memory/WindowsShared/EmulatedSharedMemoryWindows.cs b/Ryujinx.Memory/WindowsShared/EmulatedSharedMemoryWindows.cs
index 46399504..1417f7d5 100644
--- a/Ryujinx.Memory/WindowsShared/EmulatedSharedMemoryWindows.cs
+++ b/Ryujinx.Memory/WindowsShared/EmulatedSharedMemoryWindows.cs
@@ -41,10 +41,12 @@ namespace Ryujinx.Memory.WindowsShared
return Address < address + size && address < EndAddress;
}
- public void ExtendTo(ulong endAddress)
+ public void ExtendTo(ulong endAddress, RangeList<SharedMemoryMapping> list)
{
EndAddress = endAddress;
Size = endAddress - Address;
+
+ list.UpdateEndAddress(this);
}
public void AddBlocks(IEnumerable<int> blocks)
@@ -300,14 +302,14 @@ namespace Ryujinx.Memory.WindowsShared
_mappings.Remove(endOverlap);
- startOverlap.ExtendTo(endOverlap.EndAddress);
+ startOverlap.ExtendTo(endOverlap.EndAddress, _mappings);
startOverlap.AddBlocks(blocks);
startOverlap.AddBlocks(endOverlap.Blocks);
}
else if (startOverlap != null)
{
- startOverlap.ExtendTo(endAddress);
+ startOverlap.ExtendTo(endAddress, _mappings);
startOverlap.AddBlocks(blocks);
}
@@ -317,7 +319,7 @@ namespace Ryujinx.Memory.WindowsShared
if (endOverlap != null)
{
- mapping.ExtendTo(endOverlap.EndAddress);
+ mapping.ExtendTo(endOverlap.EndAddress, _mappings);
mapping.AddBlocks(endOverlap.Blocks);
@@ -381,6 +383,7 @@ namespace Ryujinx.Memory.WindowsShared
if (mapping.EndAddress > endAddress)
{
var newMapping = (SharedMemoryMapping)mapping.Split(endAddress);
+ _mappings.UpdateEndAddress(mapping);
_mappings.Add(newMapping);
if ((endAddress & MappingMask) != 0)
@@ -400,7 +403,9 @@ namespace Ryujinx.Memory.WindowsShared
// If the first region starts before the decommit address, split it by modifying its end address.
if (mapping.Address < address)
{
+ var oldMapping = mapping;
mapping = (SharedMemoryMapping)mapping.Split(address);
+ _mappings.UpdateEndAddress(oldMapping);
if ((address & MappingMask) != 0)
{
diff --git a/Ryujinx.Memory/WindowsShared/PlaceholderList.cs b/Ryujinx.Memory/WindowsShared/PlaceholderList.cs
index be8cef9c..848e410e 100644
--- a/Ryujinx.Memory/WindowsShared/PlaceholderList.cs
+++ b/Ryujinx.Memory/WindowsShared/PlaceholderList.cs
@@ -32,10 +32,12 @@ namespace Ryujinx.Memory.WindowsShared
return Address < address + size && address < EndAddress;
}
- public void ExtendTo(ulong end)
+ public void ExtendTo(ulong end, RangeList<PlaceholderBlock> list)
{
EndAddress = end;
Size = end - Address;
+
+ list.UpdateEndAddress(this);
}
}
@@ -126,13 +128,13 @@ namespace Ryujinx.Memory.WindowsShared
if (overlapStart && first.IsGranular)
{
- first.ExtendTo(endId);
+ first.ExtendTo(endId, _placeholders);
}
else
{
if (overlapStart)
{
- first.ExtendTo(id);
+ first.ExtendTo(id, _placeholders);
}
_placeholders.Add(new PlaceholderBlock(id, endId - id, true));
@@ -189,7 +191,7 @@ namespace Ryujinx.Memory.WindowsShared
if (block.Address < id && blockEnd > id)
{
- block.ExtendTo(id);
+ block.ExtendTo(id, _placeholders);
extendBlock = null;
}
else
@@ -223,7 +225,7 @@ namespace Ryujinx.Memory.WindowsShared
else
{
extendFrom = extendBlock.Address;
- extendBlock.ExtendTo(block.IsGranular ? extent : block.EndAddress);
+ extendBlock.ExtendTo(block.IsGranular ? extent : block.EndAddress, _placeholders);
}
if (block.IsGranular)