MemoryManager<T> 類別

定義

用以取代 Memory<T> 實作的抽象基底類別。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

類型參數

T

此記憶體管理員所管理之記憶體緩衝區中的專案類型。The type of items in the memory buffer managed by this memory manager.

繼承
MemoryManager<T>
實作

備註

類別是用來擴充能夠表示的Memory<T>類型知識。 MemoryManager<T>The MemoryManager<T> class is used to extend the knowledge of types that Memory<T> is able to represent. 例如,您可以從MemoryManager<T>衍生,以允許Memory<T>支援。 SafeHandleFor example, you can derive from MemoryManager<T> to allow Memory<T> to be backed by a SafeHandle.

注意

MemoryManager<T>類別適用于先進的案例。The MemoryManager<T> class is intended for advanced scenarios. 大部分的開發人員都不需要使用它。Most developers do not need to use it.

建構函式

MemoryManager<T>()

初始化 MemoryManager<T> 類別的新執行個體。Initializes a new instance of the MemoryManager<T> class.

屬性

Memory

讓這個 MemoryManager<T> 來處理記憶體區塊。Gets the memory block handled by this MemoryManager<T>.

方法

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)

從目前記憶體管理員所管理的記憶體中,傳回包含從指定位移開始之指定項目數目的記憶體緩衝區。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)

釋出目前記憶體管理員所使用的全部資源。Releases all resources used by the current memory manager.

Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(繼承來源 Object)
GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(繼承來源 Object)
GetSpan()

傳回包裝基礎記憶體緩衝區的記憶體範圍。Returns a memory span that wraps the underlying memory buffer.

GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(繼承來源 Object)
MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(繼承來源 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.

(繼承來源 Object)
TryGetArray(ArraySegment<T>)

傳回陣列區段。Returns an array segment.

Unpin()

取消釘選的記憶體,以便記憶體回收行程可以自由移動它。Unpins pinned memory so that the garbage collector is free to move it.

明確介面實作

IDisposable.Dispose()

釋出記憶體管理員所使用的全部資源。Releases all resources used by the memory manager.

適用於