using System;
using System.Buffers;
namespace Ryujinx.Memory
{
public interface IWritableBlock
{
///
/// Writes data to CPU mapped memory, with write tracking.
///
/// Virtual address to write the data into
/// Data to be written
/// Throw for unhandled invalid or unmapped memory accesses
void Write(ulong va, ReadOnlySequence data)
{
foreach (ReadOnlyMemory segment in data)
{
Write(va, segment.Span);
va += (ulong)segment.Length;
}
}
void Write(ulong va, ReadOnlySpan data);
void WriteUntracked(ulong va, ReadOnlySpan data) => Write(va, data);
}
}