Class NormalAllocation<T>
public class NormalAllocation<T> : IAlloaction<T>, IReadonlyAllocation<T>, IAllocationBase, IDisposable, IRefEnumerable<T>, IEnumerable<T>, IEnumerable where T : struct
Type Parameters
T
- Inheritance
-
NormalAllocation<T>
- Implements
-
IAlloaction<T>IEnumerable<T>
- Inherited Members
Constructors
NormalAllocation(T[])
public NormalAllocation(T[] array)
Parameters
array
T[]
Fields
array
public T[] array
Field Value
- T[]
Properties
Count
Number of items in this allocation.
public int Count { get; }
Property Value
IsDisposed
True if this alloaction has been disposed.
public bool IsDisposed { get; }
Property Value
IsReallocatable
True if this allocation can be reallocated.
public bool IsReallocatable { get; }
Property Value
this[int]
Access item.
public ref T this[int i] { get; }
Parameters
i
intThe item index. Must be less than count.
Property Value
- T
Reference to the item.
Methods
AsSpan()
This allocation as span.
public Span<T> AsSpan()
Returns
- Span<T>
Span to this allocation.
Remarks
The data pointed to by the span might be volatile. Watch out for implementation details.
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
public void Dispose()
GetEnumerator()
Get the enumerator for this object.
public IRefEnumerator<T> GetEnumerator()
Returns
- IRefEnumerator<T>
The reference enumerator.
Reallocate(int)
Reallocate this allocation with a new size.
public void Reallocate(int newSize)
Parameters
newSize
intThe new number of items to have.