MemoryManager<T> MemoryManager<T> MemoryManager<T> MemoryManager<T> Class

Definition

An abstract base class that is used to replace the implementation of Memory<T>.

generic <typename T>
public ref class MemoryManager abstract : System::Buffers::IMemoryOwner<T>, System::Buffers::IPinnable
public abstract class MemoryManager<T> : System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable
type MemoryManager<'T> = class
    interface IMemoryOwner<'T>
    interface IDisposable
    interface IPinnable
Public MustInherit Class MemoryManager(Of T)
Implements IMemoryOwner(Of T), IPinnable

Type Parameters

T

The type of items in the memory buffer managed by this memory manager.

Inheritance
MemoryManager<T>MemoryManager<T>MemoryManager<T>MemoryManager<T>
Implements

Remarks

The MemoryManager<T> class is used to extend the knowledge of types that Memory<T> is able to represent. For example, you can derive from MemoryManager<T> to allow Memory<T> to be backed by a SafeHandle.

Note

The MemoryManager<T> class is intended for advanced scenarios. Most developers do not need to use it.

Constructors

MemoryManager<T>() MemoryManager<T>() MemoryManager<T>() MemoryManager<T>()

Initializes a new instance of the MemoryManager<T> class.

Properties

Memory Memory Memory Memory

Gets the memory block handled by this MemoryManager<T>.

Methods

CreateMemory(Int32) CreateMemory(Int32) CreateMemory(Int32) CreateMemory(Int32)

Returns a memory buffer consisting of a specified number of elements from the memory managed by the current memory manager.

CreateMemory(Int32, Int32) CreateMemory(Int32, Int32) CreateMemory(Int32, Int32) CreateMemory(Int32, Int32)

Returns a memory buffer consisting of a specified number of elements starting at a specified offset from the memory managed by the current memory manager.

Dispose(Boolean) Dispose(Boolean) Dispose(Boolean) Dispose(Boolean)

Releases all resources used by the current memory manager.

Equals(Object) Equals(Object) Equals(Object) Equals(Object)

Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetSpan() GetSpan() GetSpan() GetSpan()

Returns a memory span that wraps the underlying memory buffer.

GetType() GetType() GetType() GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Pin(Int32) Pin(Int32) Pin(Int32) Pin(Int32)

Returns a handle to the memory that has been pinned and whose address can be taken.

ToString() ToString() ToString() ToString()

Returns a string that represents the current object.

(Inherited from Object)
TryGetArray(ArraySegment<T>) TryGetArray(ArraySegment<T>) TryGetArray(ArraySegment<T>) TryGetArray(ArraySegment<T>)

Returns an array segment.

Unpin() Unpin() Unpin() Unpin()

Unpins pinned memory so that the garbage collector is free to move it.

Explicit Interface Implementations

IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose() IDisposable.Dispose()

Releases all resources used by the memory manager.

Applies to