rebase cleanup
This commit is contained in:
parent
389b136d9e
commit
4e229062cf
8 changed files with 1 additions and 497 deletions
|
@ -93,20 +93,6 @@ namespace Ryujinx.Common.Memory
|
||||||
return copy;
|
return copy;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Copies <paramref name="buffer"/> into a newly rented byte memory buffer.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="buffer">The byte buffer to copy</param>
|
|
||||||
/// <returns>A <see cref="IMemoryOwner{Byte}"/> wrapping the rented memory with <paramref name="buffer"/> copied to it</returns>
|
|
||||||
public static IMemoryOwner<byte> RentCopy(ReadOnlySpan<byte> buffer)
|
|
||||||
{
|
|
||||||
var copy = RentImpl(buffer.Length);
|
|
||||||
|
|
||||||
buffer.CopyTo(copy.Memory.Span);
|
|
||||||
|
|
||||||
return copy;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static ByteMemoryPoolBuffer RentImpl(int length)
|
private static ByteMemoryPoolBuffer RentImpl(int length)
|
||||||
{
|
{
|
||||||
if ((uint)length > Array.MaxLength)
|
if ((uint)length > Array.MaxLength)
|
||||||
|
|
|
@ -1,26 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Buffers;
|
|
||||||
|
|
||||||
namespace Ryujinx.Common.Memory
|
|
||||||
{
|
|
||||||
/// <summary>
|
|
||||||
/// A concrete implementation of <seealso cref="ReadOnlySequence{T}"/>,
|
|
||||||
/// with methods to help build a full sequence.
|
|
||||||
/// </summary>
|
|
||||||
public sealed class BytesReadOnlySequenceSegment : ReadOnlySequenceSegment<byte>
|
|
||||||
{
|
|
||||||
public BytesReadOnlySequenceSegment(Memory<byte> memory) => Memory = memory;
|
|
||||||
|
|
||||||
public BytesReadOnlySequenceSegment Append(Memory<byte> memory)
|
|
||||||
{
|
|
||||||
var nextSegment = new BytesReadOnlySequenceSegment(memory)
|
|
||||||
{
|
|
||||||
RunningIndex = RunningIndex + Memory.Length
|
|
||||||
};
|
|
||||||
|
|
||||||
Next = nextSegment;
|
|
||||||
|
|
||||||
return nextSegment;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -134,16 +134,6 @@ namespace Ryujinx.Memory
|
||||||
/// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
|
/// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
|
||||||
ReadOnlySequence<byte> GetReadOnlySequence(ulong va, int size, bool tracked = false);
|
ReadOnlySequence<byte> GetReadOnlySequence(ulong va, int size, bool tracked = false);
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Gets a read-only sequence of read-only memory blocks from CPU mapped memory.
|
|
||||||
/// </summary>
|
|
||||||
/// <param name="va">Virtual address of the data</param>
|
|
||||||
/// <param name="size">Size of the data</param>
|
|
||||||
/// <param name="tracked">True if read tracking is triggered on the memory</param>
|
|
||||||
/// <returns>A read-only sequence of read-only memory of the data</returns>
|
|
||||||
/// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
|
|
||||||
ReadOnlySequence<byte> GetReadOnlySequence(ulong va, int size, bool tracked = false);
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Gets a read-only span of data from CPU mapped memory.
|
/// Gets a read-only span of data from CPU mapped memory.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|
|
@ -1,64 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Memory.Range
|
|
||||||
{
|
|
||||||
public struct PagedMemoryRangeCoalescingEnumerator
|
|
||||||
{
|
|
||||||
private PagedMemoryRangeEnumerator _enumerator;
|
|
||||||
private MemoryRange? _current;
|
|
||||||
|
|
||||||
public PagedMemoryRangeCoalescingEnumerator(ulong startAddress, int size, int pageSize, Func<ulong, ulong> mapAddress)
|
|
||||||
{
|
|
||||||
_enumerator = new PagedMemoryRangeEnumerator(startAddress, size, pageSize, mapAddress);
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly MemoryRange Current
|
|
||||||
{
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
get => _current!.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop.
|
|
||||||
/// </summary>
|
|
||||||
public readonly PagedMemoryRangeCoalescingEnumerator GetEnumerator() => this;
|
|
||||||
|
|
||||||
public bool MoveNext()
|
|
||||||
{
|
|
||||||
if (_current is null)
|
|
||||||
{
|
|
||||||
if (_enumerator.MoveNext() == false)
|
|
||||||
{
|
|
||||||
_current = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_enumerator.HasCurrent)
|
|
||||||
{
|
|
||||||
MemoryRange combinedRange = _enumerator.Current;
|
|
||||||
|
|
||||||
while (_enumerator.MoveNext())
|
|
||||||
{
|
|
||||||
MemoryRange nextRange = _enumerator.Current;
|
|
||||||
|
|
||||||
if (combinedRange.EndAddress == nextRange.Address)
|
|
||||||
{
|
|
||||||
combinedRange = new MemoryRange(combinedRange.Address, combinedRange.Size + nextRange.Size);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
_current = combinedRange;
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_current = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,78 +0,0 @@
|
||||||
using System;
|
|
||||||
using System.Runtime.CompilerServices;
|
|
||||||
|
|
||||||
namespace Ryujinx.Memory.Range
|
|
||||||
{
|
|
||||||
public struct PagedMemoryRangeEnumerator
|
|
||||||
{
|
|
||||||
private readonly ulong _startAddress;
|
|
||||||
private readonly int _size;
|
|
||||||
private readonly int _pageSize;
|
|
||||||
private readonly ulong _pageMask;
|
|
||||||
private readonly Func<ulong, ulong> _mapAddress;
|
|
||||||
private int _offset;
|
|
||||||
private MemoryRange? _current;
|
|
||||||
|
|
||||||
public PagedMemoryRangeEnumerator(ulong startAddress, int size, int pageSize, Func<ulong, ulong> mapAddress)
|
|
||||||
{
|
|
||||||
_startAddress = startAddress;
|
|
||||||
_size = size;
|
|
||||||
_pageSize = pageSize;
|
|
||||||
_pageMask = (ulong)pageSize - 1;
|
|
||||||
_mapAddress = mapAddress;
|
|
||||||
_offset = 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
public readonly MemoryRange Current
|
|
||||||
{
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
get => _current!.Value;
|
|
||||||
}
|
|
||||||
|
|
||||||
internal readonly bool HasCurrent
|
|
||||||
{
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
get => _current.HasValue;
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Returning this through a GetEnumerator() call allows it to be used directly in a foreach loop.
|
|
||||||
/// </summary>
|
|
||||||
public readonly PagedMemoryRangeEnumerator GetEnumerator() => this;
|
|
||||||
|
|
||||||
public bool MoveNext()
|
|
||||||
{
|
|
||||||
if (_offset == 0 && (_startAddress & _pageMask) != 0)
|
|
||||||
{
|
|
||||||
ulong rangeAddress = _mapAddress(_startAddress);
|
|
||||||
|
|
||||||
int rangeSize = Math.Min(_size, _pageSize - (int)(_startAddress & _pageMask));
|
|
||||||
|
|
||||||
SetCurrent(rangeAddress, rangeSize);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (_offset < _size)
|
|
||||||
{
|
|
||||||
ulong rangeAddress = _mapAddress(_startAddress + (ulong)_offset);
|
|
||||||
|
|
||||||
int rangeSize = Math.Min(_size - _offset, _pageSize);
|
|
||||||
|
|
||||||
SetCurrent(rangeAddress, rangeSize);
|
|
||||||
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
_current = null;
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
|
||||||
private void SetCurrent(ulong address, int size)
|
|
||||||
{
|
|
||||||
_current = new MemoryRange(address, (ulong)size);
|
|
||||||
_offset += size;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,169 +0,0 @@
|
||||||
using NUnit.Framework;
|
|
||||||
using Ryujinx.Memory.Range;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Tests.Memory.RangeTests
|
|
||||||
{
|
|
||||||
public class PagedMemoryRangeCoalescingEnumeratorTests
|
|
||||||
{
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_For3AlignedPages_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 12;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(1, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, results[0].Address);
|
|
||||||
Assert.AreEqual(Size, results[0].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_For2PagesWithPartialFirstAndLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 2;
|
|
||||||
const int Size = 6;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(1, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(StartAddress, results[0].Address);
|
|
||||||
Assert.AreEqual(Size, results[0].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_For4PagesWithPartialFirst_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 2;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(1, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(StartAddress, results[0].Address);
|
|
||||||
Assert.AreEqual(Size, results[0].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_For4PagesWithPartialLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(1, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(StartAddress, results[0].Address);
|
|
||||||
Assert.AreEqual(Size, results[0].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_ForPartiallyDiscontiguous4PagesWithPartialLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var memoryMap = new Dictionary<ulong, ulong>()
|
|
||||||
{
|
|
||||||
{ 0ul, 0ul }, { 4ul, 4ul }, { 8ul, 20ul }, { 12ul, 24ul },
|
|
||||||
};
|
|
||||||
ulong MemoryMapLookup(ulong a) => memoryMap.TryGetValue(a, out var value) ? value : a;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, MemoryMapLookup);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(2, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize * 2, results[0].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(20, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize + (Size % PageSize), results[1].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeCoalescingEnumerator_ForFullyDiscontiguous4PagesWithPartialLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var memoryMap = new Dictionary<ulong, ulong>()
|
|
||||||
{
|
|
||||||
{ 0ul, 0ul }, { 4ul, 10ul }, { 8ul, 20ul }, { 12ul, 30ul },
|
|
||||||
};
|
|
||||||
ulong MemoryMapLookup(ulong a) => memoryMap.TryGetValue(a, out var value) ? value : a;
|
|
||||||
var enumerator = new PagedMemoryRangeCoalescingEnumerator(StartAddress, Size, PageSize, MemoryMapLookup);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(4, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[0].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(10, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[1].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(20, results[2].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[2].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(30, results[3].Address);
|
|
||||||
Assert.AreEqual(Size % PageSize, results[3].Size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,135 +0,0 @@
|
||||||
using NUnit.Framework;
|
|
||||||
using Ryujinx.Memory.Range;
|
|
||||||
using System.Collections.Generic;
|
|
||||||
|
|
||||||
namespace Ryujinx.Tests.Memory.RangeTests
|
|
||||||
{
|
|
||||||
public class PagedMemoryRangeEnumeratorTests
|
|
||||||
{
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeEnumerator_For3AlignedPages_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 12;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(3, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[0].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(4, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[1].Size);
|
|
||||||
|
|
||||||
Assert.AreEqual(8, results[2].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[2].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeEnumerator_For2PagesWithPartialFirstAndLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 2;
|
|
||||||
const int Size = 6;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(2, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(StartAddress, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize - StartAddress, results[0].Size);
|
|
||||||
Assert.AreEqual(results[1].Address, results[0].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(4, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[1].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeEnumerator_For4PagesWithPartialFirst_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 2;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(4, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(StartAddress, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize - StartAddress, results[0].Size);
|
|
||||||
Assert.AreEqual(results[1].Address, results[0].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(4, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[1].Size);
|
|
||||||
Assert.AreEqual(results[2].Address, results[1].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(8, results[2].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[2].Size);
|
|
||||||
Assert.AreEqual(results[3].Address, results[2].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(12, results[3].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[3].Size);
|
|
||||||
}
|
|
||||||
|
|
||||||
[Test]
|
|
||||||
public void PagedMemoryRangeEnumerator_For4PagesWithPartialLast_HasCorrectResults()
|
|
||||||
{
|
|
||||||
// Arrange
|
|
||||||
const int StartAddress = 0;
|
|
||||||
const int Size = 14;
|
|
||||||
const int PageSize = 4;
|
|
||||||
var enumerator = new PagedMemoryRangeEnumerator(StartAddress, Size, PageSize, x => x);
|
|
||||||
|
|
||||||
// Act
|
|
||||||
var results = new List<MemoryRange>();
|
|
||||||
foreach (var memoryRange in enumerator)
|
|
||||||
{
|
|
||||||
results.Add(memoryRange);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Assert
|
|
||||||
Assert.AreEqual(4, results.Count);
|
|
||||||
|
|
||||||
Assert.AreEqual(0, results[0].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[0].Size);
|
|
||||||
Assert.AreEqual(results[1].Address, results[0].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(4, results[1].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[1].Size);
|
|
||||||
Assert.AreEqual(results[2].Address, results[1].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(8, results[2].Address);
|
|
||||||
Assert.AreEqual(PageSize, results[2].Size);
|
|
||||||
Assert.AreEqual(results[3].Address, results[2].EndAddress);
|
|
||||||
|
|
||||||
Assert.AreEqual(12, results[3].Address);
|
|
||||||
Assert.AreEqual(Size % PageSize, results[3].Size);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -1,6 +1,6 @@
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
using Ryujinx.Common.Extensions;
|
using Ryujinx.Common.Extensions;
|
||||||
using Ryujinx.Common.Memory;
|
using Ryujinx.Memory;
|
||||||
using System;
|
using System;
|
||||||
using System.Buffers;
|
using System.Buffers;
|
||||||
using System.Buffers.Binary;
|
using System.Buffers.Binary;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue