LLVM: llvm::ArrayRecycler< T, Align > Class Template Reference (original) (raw)

Recycle small arrays allocated from a BumpPtrAllocator. More...

#include "[llvm/Support/ArrayRecycler.h](ArrayRecycler%5F8h%5Fsource.html)"

Public Member Functions
~ArrayRecycler ()
template
void clear (AllocatorType &Allocator)
Release all the tracked allocations to the allocator.
void clear (BumpPtrAllocator &)
Special case for BumpPtrAllocator which has an empty Deallocate() function.
template
T * allocate (Capacity Cap, AllocatorType &Allocator)
Allocate an array of at least the requested capacity.
void deallocate (Capacity Cap, T *Ptr)
Deallocate an array with the specified Capacity.

template<class T, size_t Align = alignof(T)>
class llvm::ArrayRecycler< T, Align >

Recycle small arrays allocated from a BumpPtrAllocator.

Arrays are allocated in a small number of fixed sizes. For each supported array size, the ArrayRecycler keeps a free list of available arrays.

Definition at line 28 of file ArrayRecycler.h.

template<class T, size_t Align = alignof(T)>

allocate()

template<class T, size_t Align = alignof(T)>

template

Allocate an array of at least the requested capacity.

Return an existing recycled array, or allocate one from Allocator if none are available for recycling.

Definition at line 125 of file ArrayRecycler.h.

clear() [1/2]

template<class T, size_t Align = alignof(T)>

template

Release all the tracked allocations to the allocator.

The recycler must be free of any tracked allocations before being deleted.

Definition at line 104 of file ArrayRecycler.h.

clear() [2/2]

template<class T, size_t Align = alignof(T)>

Special case for BumpPtrAllocator which has an empty Deallocate() function.

There is no need to traverse the free lists, pulling all the objects into cache.

Definition at line 115 of file ArrayRecycler.h.

deallocate()

template<class T, size_t Align = alignof(T)>

Deallocate an array with the specified Capacity.

Cap must be the same capacity that was given to allocate().

Definition at line 137 of file ArrayRecycler.h.


The documentation for this class was generated from the following file: