LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
llvm::ArrayRecycler< T, Align > Class Template Reference

#include <ArrayRecycler.h>

Inheritance diagram for llvm::ArrayRecycler< T, Align >:
Inheritance graph
[legend]

Classes

class  Capacity
 

Public Member Functions

 ~ArrayRecycler ()
 
template<class AllocatorType >
void clear (AllocatorType &Allocator)
 
void clear (BumpPtrAllocator &)
 
template<class AllocatorType >
Tallocate (Capacity Cap, AllocatorType &Allocator)
 
void deallocate (Capacity Cap, T *Ptr)
 

Detailed Description

template<class T, size_t Align = AlignOf<T>::Alignment>
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 31 of file ArrayRecycler.h.

Constructor & Destructor Documentation

template<class T, size_t Align = AlignOf<T>::Alignment>
llvm::ArrayRecycler< T, Align >::~ArrayRecycler ( )
inline

Definition at line 94 of file ArrayRecycler.h.

Member Function Documentation

template<class T, size_t Align = AlignOf<T>::Alignment>
template<class AllocatorType >
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().

template<class T, size_t Align = AlignOf<T>::Alignment>
template<class AllocatorType >
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().

template<class T, size_t Align = AlignOf<T>::Alignment>
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.

template<class T, size_t Align = AlignOf<T>::Alignment>
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().


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