IndexZone Memoryasmjit::ZonePool< T, SizeOfT >

asmjit::ZonePool< T, SizeOfT > Class Template Reference [¶]

template<typename T, size_t SizeOfT = sizeof(T)>
class asmjit::ZonePool< T, SizeOfT >

Helper class for implementing pooling of arena-allocated objects.

Public Members

Classes

Member Functions

template<typename T, size_t SizeOfT = sizeof(T)>
void ZonePool<T, SizeOfT>::reset()noexcept[¶]

Resets the arena pool.

Reset must be called after the associated ArenaAllocator has been reset, otherwise the existing pool will collide with possible allocations made on the ArenaAllocator object after the reset.

template<typename T, size_t SizeOfT = sizeof(T)>
T* ZonePool<T, SizeOfT>::alloc(
Zone& zone
)noexcept[¶]

Allocates a memory (or reuses the existing allocation) of SizeOfT (in bytes).

template<typename T, size_t SizeOfT = sizeof(T)>
void ZonePool<T, SizeOfT>::release(
T* ptr
)noexcept[¶]

Pools the previously allocated memory.