LLVM API Documentation
#include <Allocator.h>
Public Member Functions | |
| BumpPtrAllocator (size_t size=4096, size_t threshold=4096, SlabAllocator &allocator=DefaultSlabAllocator) | |
| ~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. | |
Friends | |
| 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, |
||
| SlabAllocator & | allocator = DefaultSlabAllocator |
||
| ) |
Definition at line 24 of file Allocator.cpp.
| llvm::BumpPtrAllocator::~BumpPtrAllocator | ( | ) |
Definition at line 29 of file Allocator.cpp.
| void * llvm::BumpPtrAllocator::Allocate | ( | size_t | Size, |
| size_t | Alignment | ||
| ) |
Allocate - Allocate space at the specified alignment.
Definition at line 91 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< ImutIntervalInfo< ValT > >::createNode(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAddRecExpr(), 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(), llvm::yaml::Node::operator new(), operator new(), and llvm::StructType::setBody().
| T* llvm::BumpPtrAllocator::Allocate | ( | ) | [inline] |
Allocate space, but do not construct, one object.
Definition at line 155 of file Allocator.h.
Referenced by Allocate().
| T* llvm::BumpPtrAllocator::Allocate | ( | size_t | Num | ) | [inline] |
Allocate space for an array of objects. This does not construct the objects though.
Definition at line 162 of file Allocator.h.
References Allocate().
| T* llvm::BumpPtrAllocator::Allocate | ( | size_t | Num, |
| size_t | Alignment | ||
| ) | [inline] |
Allocate space for a specific count of elements and with a specified alignment.
Definition at line 169 of file Allocator.h.
References Allocate(), and T.
| void llvm::BumpPtrAllocator::Deallocate | ( | const void * | ) | [inline] |
Definition at line 175 of file Allocator.h.
Referenced by llvm::yaml::Node::operator delete(), and llvm::MachineFunction::~MachineFunction().
| unsigned llvm::BumpPtrAllocator::GetNumSlabs | ( | ) | const |
Definition at line 139 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 147 of file Allocator.cpp.
References llvm::MemSlab::NextPtr.
| void llvm::BumpPtrAllocator::PrintStats | ( | ) | const |
Definition at line 155 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 79 of file Allocator.cpp.
References llvm::MemSlab::NextPtr, and llvm::MemSlab::Size.
Referenced by llvm::SelectionDAG::clear(), llvm::SpecificBumpPtrAllocator< T >::DestroyAll(), llvm::yaml::Scanner::getNext(), llvm::LiveStacks::releaseMemory(), llvm::LiveIntervals::releaseMemory(), llvm::SlotIndexes::releaseMemory(), llvm::ScalarEvolution::releaseMemory(), and llvm::MCContext::reset().
friend class SpecificBumpPtrAllocator [friend] |
Definition at line 138 of file Allocator.h.