Namespace NumSharp.Backends.Unmanaged
Classes
- UnmanagedMemoryManager<T>
Presents a block of UNMANAGED memory as a Memory<T> / ReadOnlyMemory<T> WITHOUT taking ownership or a reference on the memory holder — the backing of Memory<T>() / ReadOnlyMemory<T>().
It is deliberately unsafe: it stores only a raw pointer, so it does NOT root the NDArray's ARC-counted buffer. A live Memory<T> keeps THIS manager object alive (a managed reference the
Memorystruct holds), but nothing here keeps the NDArray's unmanaged buffer alive. If the source NDArray is disposed or garbage-collected while a Memory<T> handed out here is still in use, the pointer dangles and every read/write corrupts memory. Keep the NDArray alive (side by side) for the entire lifetime of the Memory<T>.
Structs
- ArraySlice<T>
ArraySlice<T> is similar to Span<T> but it can be moved around without having to follow
ref structrules.