Table of Contents

Class Arena<T>

Namespace
ReFuel.Memory
Assembly
ReFuel.dll

An arena for allocating any number of the same struct.

public class Arena<T> : IAllocator<T>, IAllocator, IDisposable where T : struct

Type Parameters

T

The struct type.

Inheritance
Arena<T>
Implements
Inherited Members

Constructors

Arena(int)

public Arena(int initialCapacity = 0)

Parameters

initialCapacity int

Properties

Allocated

Number of items allocated.

public int Allocated { get; }

Property Value

int

AllocatedBytes

Amount of memory allocated in bytes.

public long AllocatedBytes { get; }

Property Value

long

Capacity

Maximum number of items to allocated.

public int Capacity { get; set; }

Property Value

int

CapacityBytes

Maximum number of bytes available for this arena.

public long CapacityBytes { get; set; }

Property Value

long

Comitted

Number of items comitted.

public int Comitted { get; }

Property Value

int

ComittedBytes

Amount of heap memory comitted for this arena.

public long ComittedBytes { get; }

Property Value

long

Methods

Allocate(int)

Allocate memory.

public IAlloaction<T> Allocate(int count)

Parameters

count int

Returns

IAlloaction<T>

Allocated memory.

Exceptions

OutOfMemoryException

Ran out of memory.

Clear(bool)

Clear all allocations in this arena.

public void Clear(bool uncommit = false)

Parameters

uncommit bool

True to uncommit the allocated memory pool

Remarks

Invalidates all allocations.

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()