LLVM 20.0.0git
Public Member Functions | List of all members
llvm::SpecificBumpPtrAllocator< T > Class Template Reference

A BumpPtrAllocator that allows only elements of a specific type to be allocated. More...

#include "llvm/Support/Allocator.h"

Inheritance diagram for llvm::SpecificBumpPtrAllocator< T >:
Inheritance graph
[legend]

Public Member Functions

 SpecificBumpPtrAllocator ()
 
 SpecificBumpPtrAllocator (SpecificBumpPtrAllocator &&Old)
 
 ~SpecificBumpPtrAllocator ()
 
SpecificBumpPtrAllocatoroperator= (SpecificBumpPtrAllocator &&RHS)
 
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.
 
TAllocate (size_t num=1)
 Allocate space for an array of objects without constructing them.
 
std::optional< int64_t > identifyObject (const void *Ptr)
 

Detailed Description

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

A BumpPtrAllocator that allows only elements of a specific type to be allocated.

This allows calling the destructor in DestroyAll() and when the allocator is destroyed.

Definition at line 389 of file Allocator.h.

Constructor & Destructor Documentation

◆ SpecificBumpPtrAllocator() [1/2]

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

Definition at line 393 of file Allocator.h.

References Allocator.

◆ SpecificBumpPtrAllocator() [2/2]

template<typename T >
llvm::SpecificBumpPtrAllocator< T >::SpecificBumpPtrAllocator ( SpecificBumpPtrAllocator< T > &&  Old)
inline

Definition at line 398 of file Allocator.h.

References Allocator.

◆ ~SpecificBumpPtrAllocator()

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

Definition at line 400 of file Allocator.h.

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

Member Function Documentation

◆ Allocate()

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

Allocate space for an array of objects without constructing them.

Definition at line 439 of file Allocator.h.

References Allocator.

Referenced by llvm::ModuleSymbolTable::addModule(), llvm::PMTopLevelManager::findAnalysisUsage(), and llvm::OnDiskChainedHashTableGenerator< Info >::insert().

◆ DestroyAll()

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 410 of file Allocator.h.

References llvm::alignAddr(), Allocator, assert(), E, End, I, Ptr, Size, and T.

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

◆ identifyObject()

template<typename T >
std::optional< int64_t > llvm::SpecificBumpPtrAllocator< T >::identifyObject ( const void *  Ptr)
inline
Returns
An index uniquely and reproducibly identifying an input pointer Ptr in the given allocator. Returns an empty optional if the pointer is not found in the allocator.

Definition at line 444 of file Allocator.h.

References Allocator, and Ptr.

◆ operator=()

template<typename T >
SpecificBumpPtrAllocator & llvm::SpecificBumpPtrAllocator< T >::operator= ( SpecificBumpPtrAllocator< T > &&  RHS)
inline

Definition at line 402 of file Allocator.h.

References Allocator, and RHS.


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