Table of Contents

Struct Memory<T>

Namespace
System
Assembly
System.Memory.dll
public readonly struct Memory<T>

Type Parameters

T
Inherited Members

Constructors

Memory(T[])

public Memory(T[] array)

Parameters

array T[]

Memory(T[], int, int)

public Memory(T[] array, int start, int length)

Parameters

array T[]
start int
length int

Properties

Empty

public static Memory<T> Empty { get; }

Property Value

Memory<T>

IsEmpty

public bool IsEmpty { get; }

Property Value

bool

Length

public int Length { get; }

Property Value

int

Span

public Span<T> Span { get; }

Property Value

Span<T>

Methods

CopyTo(Memory<T>)

public void CopyTo(Memory<T> destination)

Parameters

destination Memory<T>

Equals(Memory<T>)

public bool Equals(Memory<T> other)

Parameters

other Memory<T>

Returns

bool

Pin()

public MemoryHandle Pin()

Returns

MemoryHandle

Slice(int)

public Memory<T> Slice(int start)

Parameters

start int

Returns

Memory<T>

Slice(int, int)

public Memory<T> Slice(int start, int length)

Parameters

start int
length int

Returns

Memory<T>

ToArray()

public T[] ToArray()

Returns

T[]

ToString()

public override string ToString()

Returns

string

TryCopyTo(Memory<T>)

public bool TryCopyTo(Memory<T> destination)

Parameters

destination Memory<T>

Returns

bool

Operators

implicit operator Memory<T>(ArraySegment<T>)

public static implicit operator Memory<T>(ArraySegment<T> segment)

Parameters

segment ArraySegment<T>

Returns

Memory<T>

implicit operator ReadOnlyMemory<T>(Memory<T>)

public static implicit operator ReadOnlyMemory<T>(Memory<T> memory)

Parameters

memory Memory<T>

Returns

ReadOnlyMemory<T>

implicit operator Memory<T>(T[])

public static implicit operator Memory<T>(T[] array)

Parameters

array T[]

Returns

Memory<T>