Enhanced C#
Loyc library documentation
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events Pages
Public fields | Properties | Public Member Functions | Static Public Member Functions | List of all members
ReadOnlyMemory2< T > Struct Template Reference

ReadOnlyMemory{T}.Span is slower than you'd expect (even on modern .NET) because it holds an object reference and every call to Span must figure out what kind of object it is (there are three cases). This type exists to speed up that property in the usual case that it's an array. More...


Source file:

Remarks

ReadOnlyMemory{T}.Span is slower than you'd expect (even on modern .NET) because it holds an object reference and every call to Span must figure out what kind of object it is (there are three cases). This type exists to speed up that property in the usual case that it's an array.

Public fields

readonly ReadOnlyMemory< T > _mem
 
readonly T[] _array
 
readonly int _arrayOffset
 
ReadOnlyMemory< T > Memory => _mem
 The underlying ReadOnlyMemory{T}. More...
 

Properties

ReadOnlySpan< T > Span [get, set]
 
int Length [get]
 

Public Member Functions

 ReadOnlyMemory2 (ReadOnlyMemory< T > mem)
 
ReadOnlyMemory< T > Slice (int start)
 
ReadOnlyMemory< T > Slice (int start, int length)
 
T[] ToArray ()
 

Static Public Member Functions

static implicit operator ReadOnlyMemory2< T > (ReadOnlyMemory< T > mem)
 

Member Data Documentation

ReadOnlyMemory<T> ReadOnlyMemory2< T >.Memory => _mem

The underlying ReadOnlyMemory{T}.