new: add IWritableBlock.Write(ulong, ReadOnlySequence<byte>) with default impl
This commit is contained in:
parent
0ff59b2eb3
commit
21a73b8ad2
1 changed files with 16 additions and 0 deletions
|
@ -1,9 +1,25 @@
|
|||
using System;
|
||||
using System.Buffers;
|
||||
|
||||
namespace Ryujinx.Memory
|
||||
{
|
||||
public interface IWritableBlock
|
||||
{
|
||||
/// <summary>
|
||||
/// Writes data to CPU mapped memory, with write tracking.
|
||||
/// </summary>
|
||||
/// <param name="va">Virtual address to write the data into</param>
|
||||
/// <param name="data">Data to be written</param>
|
||||
/// <exception cref="InvalidMemoryRegionException">Throw for unhandled invalid or unmapped memory accesses</exception>
|
||||
void Write(ulong va, ReadOnlySequence<byte> data)
|
||||
{
|
||||
foreach (ReadOnlyMemory<byte> segment in data)
|
||||
{
|
||||
Write(va, segment.Span);
|
||||
va += (ulong)segment.Length;
|
||||
}
|
||||
}
|
||||
|
||||
void Write(ulong va, ReadOnlySpan<byte> data);
|
||||
|
||||
void WriteUntracked(ulong va, ReadOnlySpan<byte> data) => Write(va, data);
|
||||
|
|
Loading…
Add table
Reference in a new issue