-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Closed
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtime.InteropServices
Milestone
Description
Proposal:
namespace System.Runtime.InteropServices
{
public abstract unsafe class SafeBuffer
{
public void ReadSpan<T>(ulong byteOffset, Span<T> buffer) where T : struct => throw null;
public void WriteSpan<T>(ulong byteOffset, ReadOnlySpan<T> data) where T : struct => throw null;
}
}The purpose of this is to be a Span-based equivalent of ReadArray. The motivation for this is for a later API proposal to add the same methods to UnmanagedMemoryAccessor which will work for memory mapped views.
This would make it possible to work efficiently and safely with stackalloc'ed data.
Metadata
Metadata
Assignees
Labels
api-approvedAPI was approved in API review, it can be implementedAPI was approved in API review, it can be implementedarea-System.Runtime.InteropServices