SpecificBumpPtrAllocator - Same as BumpPtrAllocator but allows only elements of one type to be allocated. More...
#include <Allocator.h>
Public Member Functions | |
SpecificBumpPtrAllocator (size_t size=4096, size_t threshold=4096, SlabAllocator &allocator=BumpPtrAllocator::DefaultSlabAllocator) | |
~SpecificBumpPtrAllocator () | |
void | DestroyAll () |
Call the destructor of each allocated object and deallocate all but the current slab and reset the current pointer to the beginning of it, freeing all memory allocated so far. | |
T * | Allocate (size_t num=1) |
Allocate space for a specific count of elements. | |
Private Attributes | |
BumpPtrAllocator | Allocator |
SpecificBumpPtrAllocator - Same as BumpPtrAllocator but allows only elements of one type to be allocated.
This allows calling the destructor in DestroyAll() and when the allocator is destroyed.
llvm::SpecificBumpPtrAllocator< T >::SpecificBumpPtrAllocator | ( | size_t | size = 4096 , |
|
size_t | threshold = 4096 , |
|||
SlabAllocator & | allocator = BumpPtrAllocator::DefaultSlabAllocator | |||
) | [inline] |
llvm::SpecificBumpPtrAllocator< T >::~SpecificBumpPtrAllocator | ( | ) | [inline] |
T* llvm::SpecificBumpPtrAllocator< T >::Allocate | ( | size_t | num = 1 |
) | [inline] |
Allocate space for a specific count of elements.
void llvm::SpecificBumpPtrAllocator< T >::DestroyAll | ( | ) | [inline] |
Call the destructor of each allocated object and deallocate all but the current slab and reset the current pointer to the beginning of it, freeing all memory allocated so far.
BumpPtrAllocator llvm::SpecificBumpPtrAllocator< T >::Allocator [private] |