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
Memory2< T > Struct Template Reference

Memory{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

Memory{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 Memory< T > _mem
 
readonly T[] _array
 
readonly int _arrayOffset
 
Memory< T > Memory => _mem
 The underlying Memory{T}. More...
 

Properties

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

Public Member Functions

 Memory2 (Memory< T > mem)
 
Memory< T > Slice (int start)
 
Memory< T > Slice (int start, int length)
 
T[] ToArray ()
 

Static Public Member Functions

static implicit operator Memory2< T > (Memory< T > mem)
 

Member Data Documentation

Memory<T> Memory2< T >.Memory => _mem

The underlying Memory{T}.