Olvasás angol nyelven Szerkesztés

Megosztás a következőn keresztül:


MemoryManager<T> Class

Definition

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

C#
public abstract class MemoryManager<T> : System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable
C#
public abstract class MemoryManager<T> : IDisposable, System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable

Type Parameters

T

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

Inheritance
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.

Megjegyzés

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

Constructors

MemoryManager<T>()

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

Properties

Memory

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

Methods

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.

CreateMemory(Int32)

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

Dispose(Boolean)

Releases all resources used by the current memory manager.

Equals(Object)

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

(Inherited from Object)
GetHashCode()

Serves as the default hash function.

(Inherited from Object)
GetSpan()

Returns a memory span that wraps the underlying memory buffer.

GetType()

Gets the Type of the current instance.

(Inherited from Object)
MemberwiseClone()

Creates a shallow copy of the current Object.

(Inherited from Object)
Pin(Int32)

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

ToString()

Returns a string that represents the current object.

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

Returns an array segment.

Unpin()

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

Explicit Interface Implementations

IDisposable.Dispose()

Releases all resources used by the memory manager.

Applies to

Termék Verziók
.NET Core 2.1, Core 2.2, Core 3.0, Core 3.1, 5, 6, 7, 8, 9, 10
.NET Standard 2.0 (package-provided), 2.1