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


用以取代 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



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



MemoryManager<T>類別是用來擴充類型的知識Memory<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>() MemoryManager<T>() MemoryManager<T>()

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


Memory Memory Memory Memory

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


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()

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

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

建立目前 Object 的淺層複本 (Shallow Copy)。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.


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

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