Interface IArraySlice
public interface IArraySlice : IMemoryBlock, ICloneable, IEnumerable
- Inherited Members
- Extension Methods
Properties
this[int]
object this[int index] { get; set; }
Parameters
indexint
Property Value
MemoryBlock
IMemoryBlock MemoryBlock { get; }
Property Value
Methods
AsSpan<T>()
Span<T> AsSpan<T>()
Returns
- Span<T>
Type Parameters
T
Remarks
Does not perform copy.
Clone()
IArraySlice Clone()
Returns
Clone<T>()
ArraySlice<T> Clone<T>() where T : unmanaged
Returns
- ArraySlice<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(int)
object GetIndex(int index)
Parameters
indexint
Returns
GetIndex<T>(int)
T GetIndex<T>(int index) where T : unmanaged
Parameters
indexint
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(int, object)
void SetIndex(int index, object value)
Parameters
SetIndex<T>(int, T)
void SetIndex<T>(int index, T value) where T : unmanaged
Parameters
indexintvalueT
Type Parameters
T
Slice(int)
Perform a slicing on this IMemoryBlock without copying data.
IArraySlice Slice(int start)
Parameters
startintThe index to start from
Returns
Remarks
Creates a slice without copying.
Slice(int, int)
Perform a slicing on this IMemoryBlock without copying data.
IArraySlice Slice(int start, int count)
Parameters
Returns
Remarks
Creates a slice without copying.
ToArray()
Copies this IArraySlice contents into a new array.
Array ToArray()