With the introduction of Memory, Span and ArraySegment in C# 7.2, I was wondering if I could represent an unmanaged array as an enumerable object, that lives on the heap.
This latter requirement rules out Span, which basically implemented exactly what I wanted: e.g.
unsafe { bytes = new Span<byte>((byte*)ptr + (index * Width), Width);
Is it possible to do the same with ArraySegment or Memory? Their constructors only accept byte[], maybe there some way to trick C# into passing a byte* instead of byte[]?