LLVM API Documentation
#include <Allocator.h>
Public Member Functions | |
BumpPtrAllocator (size_t size=4096, size_t threshold=4096) | |
BumpPtrAllocator (size_t size, size_t threshold, SlabAllocator &allocator) | |
~BumpPtrAllocator () | |
void | Reset () |
void * | Allocate (size_t Size, size_t Alignment) |
template<typename T > | |
T * | Allocate () |
template<typename T > | |
T * | Allocate (size_t Num) |
template<typename T > | |
T * | Allocate (size_t Num, size_t Alignment) |
void | Deallocate (const void *) |
unsigned | GetNumSlabs () const |
void | PrintStats () const |
size_t | getTotalMemory () const |
Compute the total physical memory allocated by this allocator. More... | |
Friends | |
template<typename T > | |
class | SpecificBumpPtrAllocator |
BumpPtrAllocator - This allocator is useful for containers that need very simple memory allocation strategies. In particular, this just keeps allocating memory, and never deletes it until the entire block is dead. This makes allocation speedy, but must only be used when the trade-off is ok.
Definition at line 90 of file Allocator.h.
llvm::BumpPtrAllocator::BumpPtrAllocator | ( | size_t | size = 4096 , |
size_t | threshold = 4096 |
||
) |
Definition at line 29 of file Allocator.cpp.
llvm::BumpPtrAllocator::BumpPtrAllocator | ( | size_t | size, |
size_t | threshold, | ||
SlabAllocator & | allocator | ||
) |
Definition at line 24 of file Allocator.cpp.
llvm::BumpPtrAllocator::~BumpPtrAllocator | ( | ) |
Definition at line 33 of file Allocator.cpp.
void * llvm::BumpPtrAllocator::Allocate | ( | size_t | Size, |
size_t | Alignment | ||
) |
Allocate - Allocate space at the specified alignment.
Definition at line 95 of file Allocator.cpp.
References __msan_allocated_memory, llvm::SlabAllocator::Allocate(), llvm::MemSlab::NextPtr, and llvm::MemSlab::Size.
Referenced by llvm::SpecificBumpPtrAllocator< T >::Allocate(), llvm::MCContext::Allocate(), llvm::MachineFunction::allocateMemRefsArray(), llvm::SSAUpdaterImpl< UpdaterT >::BuildBlockList(), llvm::ImmutableListFactory< T >::concat(), llvm::ImutAVLFactory< ImutInfo >::createNode(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAddRecExpr(), llvm::SelectionDAG::getAtomic(), llvm::MachineFunction::getInfo(), llvm::SelectionDAG::getMachineNode(), llvm::ScalarEvolution::getMulExpr(), llvm::ScalarEvolution::getSMaxExpr(), llvm::ScalarEvolution::getUMaxExpr(), llvm::SelectionDAG::getVectorShuffle(), llvm::SelectionDAG::getVTList(), llvm::FoldingSetNodeID::Intern(), llvm::SelectionDAG::MorphNodeTo(), and llvm::StructType::setBody().
|
inline |
Allocate space, but do not construct, one object.
Definition at line 156 of file Allocator.h.
Referenced by Allocate().
|
inline |
Allocate space for an array of objects. This does not construct the objects though.
Definition at line 163 of file Allocator.h.
References Allocate().
|
inline |
Allocate space for a specific count of elements and with a specified alignment.
Definition at line 170 of file Allocator.h.
References Allocate(), and T.
|
inline |
Definition at line 176 of file Allocator.h.
Referenced by llvm::MachineFunction::~MachineFunction().
unsigned llvm::BumpPtrAllocator::GetNumSlabs | ( | ) | const |
Definition at line 143 of file Allocator.cpp.
References llvm::MemSlab::NextPtr.
size_t llvm::BumpPtrAllocator::getTotalMemory | ( | ) | const |
Compute the total physical memory allocated by this allocator.
Definition at line 151 of file Allocator.cpp.
References llvm::MemSlab::NextPtr.
void llvm::BumpPtrAllocator::PrintStats | ( | ) | const |
Definition at line 159 of file Allocator.cpp.
References llvm::errs(), and llvm::MemSlab::NextPtr.
void llvm::BumpPtrAllocator::Reset | ( | ) |
Reset - Deallocate all but the current slab and reset the current pointer to the beginning of it, freeing all memory allocated so far.
Definition at line 83 of file Allocator.cpp.
References llvm::MemSlab::NextPtr, and llvm::MemSlab::Size.
Referenced by llvm::SelectionDAG::clear(), llvm::SpecificBumpPtrAllocator< T >::DestroyAll(), llvm::LiveStacks::releaseMemory(), llvm::LiveIntervals::releaseMemory(), llvm::SlotIndexes::releaseMemory(), llvm::ScalarEvolution::releaseMemory(), and llvm::MCContext::reset().
|
friend |
Definition at line 139 of file Allocator.h.