MemoryManager<T> Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
generic <typename T>
public ref class MemoryManager abstract : IDisposable, System::Buffers::IMemoryOwner<T>, System::Buffers::IPinnable
public abstract class MemoryManager<T> : System.Buffers.IMemoryOwner<T>, System.Buffers.IPinnable
public abstract class MemoryManager<T> : IDisposable, 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
Public MustInherit Class MemoryManager(Of T)
Implements IDisposable, IMemoryOwner(Of T), 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.
Note
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
.NET