Interface IArraySlice
public interface IArraySlice : IMemoryBlock, ICloneable, IEnumerable
- Inherited Members
- Extension Methods
Properties
this[long]
object this[long index] { get; set; }
Parameters
indexlong
Property Value
MemoryBlock
IMemoryBlock MemoryBlock { get; }
Property Value
Methods
AsSpan<T>()
Returns an UnmanagedSpan representing this slice's memory.
UnmanagedSpan<T> AsSpan<T>() where T : unmanaged
Returns
Type Parameters
T
Remarks
Does not perform copy. Supports long indexing for arrays > 2B elements.
Clone()
IArraySlice Clone()
Returns
Clone<T>()
ArraySlice<T> Clone<T>() where T : unmanaged
Returns
- ArraySlice<T>
Type Parameters
T
CopyTo<T>(UnmanagedSpan<T>)
Copies this slice's contents to an UnmanagedSpan destination. Supports long indexing for arrays > 2B elements.
void CopyTo<T>(UnmanagedSpan<T> destination) where T : unmanaged
Parameters
destinationUnmanagedSpan<T>
Type Parameters
T
CopyTo<T>(Span<T>)
void CopyTo<T>(Span<T> destination)
Parameters
destinationSpan<T>
Type Parameters
T
DangerousFree()
Performs dispose on the internal unmanaged memory block.
void DangerousFree()
Remarks
Dangerous because this ArraySlice might be a IsSlice therefore there might be other slices that point to current MemoryBlock.
So releasing the MemoryBlock might cause memory corruption elsewhere.
It is best to leave MemoryBlock to GC.
Fill(object)
Fills all indexes with value.
void Fill(object value)
Parameters
valueobject
GetIndex(long)
object GetIndex(long index)
Parameters
indexlong
Returns
GetIndex<T>(long)
T GetIndex<T>(long index) where T : unmanaged
Parameters
indexlong
Returns
- T
Type Parameters
T
GetPinnableReference<T>()
Gets pinnable reference of the first item in the memory block storage.
ref T GetPinnableReference<T>() where T : unmanaged
Returns
- T
Type Parameters
T
SetIndex(long, object)
void SetIndex(long index, object value)
Parameters
SetIndex<T>(long, T)
void SetIndex<T>(long index, T value) where T : unmanaged
Parameters
indexlongvalueT
Type Parameters
T
Slice(long)
Perform a slicing on this IMemoryBlock without copying data.
IArraySlice Slice(long start)
Parameters
startlongThe index to start from
Returns
Remarks
Creates a slice without copying.
Slice(long, long)
Perform a slicing on this IMemoryBlock without copying data.
IArraySlice Slice(long start, long count)
Parameters
Returns
Remarks
Creates a slice without copying.
ToArray()
Copies this IArraySlice contents into a new array.
Array ToArray()