Table of Contents

Struct BumpAllocationAny<T>

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

Type Parameters

T
Implements
Inherited Members

Constructors

BumpAllocationAny(BumpAllocator, DisposeToken, nint, nint)

public BumpAllocationAny(BumpAllocator allocator, DisposeToken token, nint head, nint tail)

Parameters

allocator BumpAllocator
token DisposeToken
head nint
tail nint

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.