Class NativeMemoryManager
public class NativeMemoryManager : MemoryManager<byte>, IMemoryOwner<byte>, IDisposable, IPinnable
- Inheritance
-
NativeMemoryManager
- Implements
- Inherited Members
Constructors
NativeMemoryManager(IntPtr, int, int)
public NativeMemoryManager(IntPtr ptr, int offset, int length)
Parameters
Methods
Dispose(bool)
Clean up of any leftover managed and unmanaged resources.
protected override void Dispose(bool disposing)
Parameters
disposing
bool
~NativeMemoryManager()
protected ~NativeMemoryManager()
GetSpan()
Returns a span wrapping the underlying memory.
public override Span<byte> GetSpan()
Returns
Pin(int)
Returns a handle to the memory that has been pinned and hence its address can be taken.
public override MemoryHandle Pin(int elementIndex = 0)
Parameters
elementIndex
intThe offset to the element within the memory at which the returned MemoryHandle points to. (default = 0)
Returns
Unpin()
Lets the garbage collector know that the object is free to be moved now.
public override void Unpin()