|
LLVM
3.7.0
|
Allocate memory in an ever growing pool, as if by bump-pointer. More...
#include <Allocator.h>
Public Member Functions | |
| BumpPtrAllocatorImpl () | |
| template<typename T > | |
| BumpPtrAllocatorImpl (T &&Allocator) | |
| BumpPtrAllocatorImpl (BumpPtrAllocatorImpl &&Old) | |
| ~BumpPtrAllocatorImpl () | |
| BumpPtrAllocatorImpl & | operator= (BumpPtrAllocatorImpl &&RHS) |
| void | Reset () |
| Deallocate all but the current slab and reset the current pointer to the beginning of it, freeing all memory allocated so far. More... | |
| LLVM_ATTRIBUTE_RETURNS_NONNULL LLVM_ATTRIBUTE_RETURNS_NOALIAS void * | Allocate (size_t Size, size_t Alignment) |
| Allocate space at the specified alignment. More... | |
| void | Deallocate (const void *, size_t) |
| size_t | GetNumSlabs () const |
| size_t | getTotalMemory () const |
| void | PrintStats () const |
Public Member Functions inherited from llvm::AllocatorBase< BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold > > | |
| void * | Allocate (size_t Size, size_t Alignment) |
| Allocate Size bytes of Alignment aligned memory. More... | |
| T * | Allocate (size_t Num=1) |
| Allocate space for a sequence of objects without constructing them. More... | |
| void | Deallocate (const void *Ptr, size_t Size) |
| Deallocate Ptr to Size bytes of memory allocated by this allocator. More... | |
| std::enable_if< !std::is_same < typename std::remove_cv< T > ::type, void >::value, void > ::type | Deallocate (T *Ptr, size_t Num=1) |
| Deallocate space for a sequence of objects without constructing them. More... | |
Friends | |
| template<typename T > | |
| class | SpecificBumpPtrAllocator |
Allocate memory in an ever growing pool, as if by bump-pointer.
This isn't strictly a bump-pointer allocator as it uses backing slabs of memory rather than relying on a boundless contiguous heap. However, it has bump-pointer semantics in that it is a monotonically growing pool of memory where every allocation is found by merely allocating the next N bytes in the slab, or the next N bytes in the next slab.
Note that this also has a threshold for forcing allocations above a certain size into their own slab.
The BumpPtrAllocatorImpl template defaults to using a MallocAllocator object, which wraps malloc, to allocate memory, but it can be changed to use a custom allocator.
Definition at line 135 of file Allocator.h.
|
inline |
Definition at line 144 of file Allocator.h.
|
inline |
Definition at line 147 of file Allocator.h.
|
inline |
Definition at line 153 of file Allocator.h.
|
inline |
Definition at line 164 of file Allocator.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
Allocate space at the specified alignment.
Definition at line 208 of file Allocator.h.
References __msan_allocated_memory, llvm::alignAddr(), llvm::alignmentAdjustment(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().
Referenced by llvm::SpecificBumpPtrAllocator< llvm::LazyCallGraph::SCC >::Allocate(), llvm::MCContext::allocate(), llvm::MachineFunction::allocateMemRefsArray(), llvm::MachineFunction::allocateRegisterMask(), llvm::SSAUpdaterImpl< UpdaterT >::BuildBlockList(), llvm::ImmutableListFactory< T >::concat(), llvm::MachineFunctionInfo::create(), llvm::ImutAVLFactory< ImutInfo >::createNode(), llvm::ScalarEvolution::getAddExpr(), llvm::ScalarEvolution::getAddRecExpr(), llvm::SelectionDAG::getAtomic(), 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::StringSaver::saveImpl(), and llvm::StructType::setBody().
|
inline |
Definition at line 255 of file Allocator.h.
Referenced by llvm::MachineFunction::~MachineFunction().
|
inline |
Definition at line 260 of file Allocator.h.
References llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
Definition at line 262 of file Allocator.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorTemplateCommon< T, typename >::end(), and I.
Referenced by llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >::PrintStats().
|
inline |
Definition at line 169 of file Allocator.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), and llvm::SmallVectorTemplateCommon< T, typename >::end().
|
inline |
Definition at line 271 of file Allocator.h.
References llvm::BumpPtrAllocatorImpl< AllocatorT, SlabSize, SizeThreshold >::getTotalMemory(), llvm::detail::printBumpPtrAllocatorStats(), and llvm::SmallVectorTemplateCommon< T, typename >::size().
|
inline |
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 189 of file Allocator.h.
References llvm::SmallVectorTemplateCommon< T, typename >::begin(), llvm::SmallVectorImpl< T >::clear(), llvm::SmallVectorBase::empty(), llvm::SmallVectorTemplateCommon< T, typename >::end(), llvm::SmallVectorImpl< T >::erase(), and llvm::SmallVectorTemplateCommon< T, typename >::front().
Referenced by llvm::SDDbgInfo::clear(), llvm::SelectionDAG::clear(), llvm::SpecificBumpPtrAllocator< llvm::LazyCallGraph::SCC >::DestroyAll(), llvm::LiveStacks::releaseMemory(), llvm::LiveIntervals::releaseMemory(), llvm::SlotIndexes::releaseMemory(), llvm::ScalarEvolution::releaseMemory(), and llvm::MCContext::reset().
|
friend |
Definition at line 337 of file Allocator.h.
1.8.6