Table of Contents

Struct BumpAllocation<T>

Namespace
ReFuel.Memory
Assembly
ReFuel.dll
public struct BumpAllocation<T> : IAlloaction<T>, IReadonlyAllocation<T>, IAllocationBase, IDisposable, IRefEnumerable<T>, IEnumerable<T>, IEnumerable where T : struct

Type Parameters

T
Implements
Inherited Members

Constructors

BumpAllocation(BumpAllocator<T>, DisposeToken, int, int)

public BumpAllocation(BumpAllocator<T> allocator, DisposeToken token, int head, int tail)

Parameters

allocator BumpAllocator<T>
token DisposeToken
head int
tail int

Properties

Count

Number of items in this allocation.

public int Count { get; }

Property Value

int

IsDisposed

True if this alloaction has been disposed.

public bool IsDisposed { get; }

Property Value

bool

IsReallocatable

True if this allocation can be reallocated.

public bool IsReallocatable { get; }

Property Value

bool

this[int]

Access item.

public ref T this[int i] { get; }

Parameters

i int

The 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 int

The new number of items to have.