Struct BumpAllocationAny<T>
public struct BumpAllocationAny<T> : IAlloaction<T>, IReadonlyAllocation<T>, IAllocationBase, IDisposable, IRefEnumerable<T>, IEnumerable<T>, IEnumerable where T : unmanaged
Type Parameters
T
- Implements
-
IAlloaction<T>IEnumerable<T>
- Inherited Members
Constructors
BumpAllocationAny(BumpAllocator, DisposeToken, nint, nint)
public BumpAllocationAny(BumpAllocator allocator, DisposeToken token, nint head, nint tail)
Parameters
allocator
BumpAllocatortoken
DisposeTokenhead
ninttail
nint
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.