Marshal. Create Span<T>(T, Int32) Method
Creates a new span over a portion of a regular managed object.
public: generic <typename T> static Span<T> CreateSpan(T % reference, int length);
public static Span<T> CreateSpan<T> (ref T reference, int length);
static member CreateSpan : 'T * int -> Span<'T>
Public Shared Function CreateSpan(Of T) (ByRef reference As T, length As Integer) As Span(Of T)
The type of the data items.
A reference to data.
The number of
T elements that
This method can be useful if part of a managed object represents a fixed array.
This method should be used with caution. It is dangerous because the
length argument is not checked. In addition, the lifetime of the returned span is not validated for safety by span-aware languages.