LLVM API Documentation

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

#include <Allocator.h>

Public Member Functions

 SpecificBumpPtrAllocator (size_t size=4096, size_t threshold=4096)
 
 SpecificBumpPtrAllocator (size_t size, size_t threshold, SlabAllocator &allocator)
 
 ~SpecificBumpPtrAllocator ()
 
void DestroyAll ()
 
TAllocate (size_t num=1)
 Allocate space for a specific count of elements. More...
 

Detailed Description

template<typename T>
class llvm::SpecificBumpPtrAllocator< T >

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.

Definition at line 190 of file Allocator.h.

Constructor & Destructor Documentation

template<typename T>
llvm::SpecificBumpPtrAllocator< T >::SpecificBumpPtrAllocator ( size_t  size = 4096,
size_t  threshold = 4096 
)
inline

Definition at line 193 of file Allocator.h.

template<typename T>
llvm::SpecificBumpPtrAllocator< T >::SpecificBumpPtrAllocator ( size_t  size,
size_t  threshold,
SlabAllocator allocator 
)
inline

Definition at line 195 of file Allocator.h.

template<typename T>
llvm::SpecificBumpPtrAllocator< T >::~SpecificBumpPtrAllocator ( )
inline

Definition at line 199 of file Allocator.h.

References llvm::SpecificBumpPtrAllocator< T >::DestroyAll().

Member Function Documentation

template<typename T>
T* llvm::SpecificBumpPtrAllocator< T >::Allocate ( size_t  num = 1)
inline

Allocate space for a specific count of elements.

Definition at line 222 of file Allocator.h.

References llvm::BumpPtrAllocator::Allocate().

template<typename T>
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.

Definition at line 206 of file Allocator.h.

References for(), llvm::MemSlab::NextPtr, llvm::BumpPtrAllocator::Reset(), llvm::MemSlab::Size, and T.

Referenced by llvm::SpecificBumpPtrAllocator< T >::~SpecificBumpPtrAllocator().


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