Table of Contents

Namespace NumSharp.Backends.Unmanaged

Classes

ArraySlice
StringArraySlice

The ELEMENT view of a fixed-width string buffer (S or U) — the IArraySlice a string UnmanagedStorage holds as its InternalArray. The bytes live in an ordinary ArraySlice<T> of byte (Bytes, so pooling, reference counting and lifetime are exactly the numeric lanes'); this object only says how to count them: one element is ItemSize bytes, its type is String, and its descriptor is Descr.

UnmanagedHelper
UnmanagedMemoryBlock
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 Memory struct 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>.

VStringArraySlice

The ELEMENT view of a NEP 55 StringDType buffer — the IArraySlice a T UnmanagedStorage holds as its InternalArray. The elements are NumPy's 16-byte packed cells (Cells, an ordinary ArraySlice<T> of byte, so pooling, reference counting and views are the numeric lanes'); the text of elements longer than 15 bytes lives in the buffer's Allocator (an arena and heap strings), which the cells' memory block owns.

Structs

ArraySlice<T>

ArraySlice<T> is similar to Span<T> but it can be moved around without having to follow ref struct rules.

UnmanagedMemoryBlock<T>

Interfaces

IArraySlice
IMemoryBlock
IMemoryBlock<T>
IUnmanagedMemoryBlock