LLVM API Documentation
#include <ArrayRecycler.h>
Classes | |
class | Capacity |
struct | FreeList |
Public Member Functions | |
~ArrayRecycler () | |
template<class AllocatorType > | |
void | clear (AllocatorType &Allocator) |
void | clear (BumpPtrAllocator &) |
template<class AllocatorType > | |
T * | allocate (Capacity Cap, AllocatorType &Allocator) |
void | deallocate (Capacity Cap, T *Ptr) |
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 30 of file ArrayRecycler.h.
llvm::ArrayRecycler< T, Align >::~ArrayRecycler | ( | ) | [inline] |
Definition at line 94 of file ArrayRecycler.h.
T* llvm::ArrayRecycler< T, Align >::allocate | ( | Capacity | Cap, |
AllocatorType & | Allocator | ||
) | [inline] |
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 124 of file ArrayRecycler.h.
Referenced by llvm::MachineFunction::allocateOperandArray().
void llvm::ArrayRecycler< T, Align >::clear | ( | AllocatorType & | Allocator | ) | [inline] |
Release all the tracked allocations to the allocator. The recycler must be free of any tracked allocations before being deleted.
Definition at line 103 of file ArrayRecycler.h.
Referenced by llvm::MachineFunction::~MachineFunction().
void llvm::ArrayRecycler< T, Align >::clear | ( | BumpPtrAllocator & | ) | [inline] |
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 114 of file ArrayRecycler.h.
void llvm::ArrayRecycler< T, Align >::deallocate | ( | Capacity | Cap, |
T * | Ptr | ||
) | [inline] |
Deallocate an array with the specified Capacity.
Cap must be the same capacity that was given to allocate().
Definition at line 136 of file ArrayRecycler.h.
Referenced by llvm::MachineFunction::deallocateOperandArray().