LLVM
8.0.1
|
Recycle small arrays allocated from a BumpPtrAllocator. More...
#include "llvm/Support/ArrayRecycler.h"
Classes | |
class | Capacity |
The size of an allocated array is represented by a Capacity instance. More... | |
Public Member Functions | |
~ArrayRecycler () | |
template<class AllocatorType > | |
void | clear (AllocatorType &Allocator) |
Release all the tracked allocations to the allocator. More... | |
void | clear (BumpPtrAllocator &) |
Special case for BumpPtrAllocator which has an empty Deallocate() function. More... | |
template<class AllocatorType > | |
T * | allocate (Capacity Cap, AllocatorType &Allocator) |
Allocate an array of at least the requested capacity. More... | |
void | deallocate (Capacity Cap, T *Ptr) |
Deallocate an array with the specified Capacity. More... | |
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 29 of file ArrayRecycler.h.
|
inline |
Definition at line 96 of file ArrayRecycler.h.
|
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 126 of file ArrayRecycler.h.
Referenced by llvm::MachineFunction::allocateOperandArray(), and llvm::GVNExpression::BasicExpression::allocateOperands().
|
inline |
Release all the tracked allocations to the allocator.
The recycler must be free of any tracked allocations before being deleted.
Definition at line 105 of file ArrayRecycler.h.
Referenced by llvm::GVNExpression::Expression::dump(), and llvm::MachineFunction::~MachineFunction().
|
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 116 of file ArrayRecycler.h.
|
inline |
Deallocate an array with the specified Capacity.
Cap must be the same capacity that was given to allocate().
Definition at line 138 of file ArrayRecycler.h.
Referenced by llvm::MachineFunction::deallocateOperandArray(), and llvm::GVNExpression::BasicExpression::deallocateOperands().