llvm::ArrayRecycler

Recycle small arrays allocated from a BumpPtrAllocator.

Synopsis

Declared in <llvm/Support/ArrayRecycler.h>

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

Description

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

Types

NameDescription
Capacity The size of an allocated array is represented by a Capacity instance.

Member Functions

NameDescription
~ArrayRecycler [destructor]Destroy the recycler; call clear() first so recycled arrays are returned.
allocate Allocate an array of at least the requested capacity.
clear clear overloads
deallocate Deallocate an array with the specified Capacity.