IBAMR  IBAMR version 0.19.
Public Member Functions | Static Public Member Functions | Static Private Member Functions | Static Private Attributes | List of all members
SAMRAI::tbox::Array< TYPE >::Allocator Class Reference

Public Member Functions

 Allocator ()
 
 Allocator (const Allocator &)=delete
 
Allocatoroperator= (const Allocator &)=delete
 
 ~Allocator ()
 
TYPE * allocate (const std::size_t block_size)
 

Static Public Member Functions

static AllocatorgetAllocator ()
 
static std::size_t getNumberOfAllocations ()
 
static void deallocate (TYPE *const block, const std::size_t block_size)
 

Static Private Member Functions

static std::size_t get_block_id (const std::size_t block_size)
 

Static Private Attributes

static bool s_is_available
 
static std::size_t s_number_of_allocations
 
static std::vector< std::vector< TYPE * > > s_block_stacks
 

Detailed Description

template<class TYPE>
class SAMRAI::tbox::Array< TYPE >::Allocator

Internal allocation class. Responsible for managing a memory pool for each type of Array.

Constructor & Destructor Documentation

◆ Allocator() [1/2]

template<class TYPE >
SAMRAI::tbox::Array< TYPE >::Allocator::Allocator ( )
inline

◆ Allocator() [2/2]

template<class TYPE >
SAMRAI::tbox::Array< TYPE >::Allocator::Allocator ( const Allocator )
delete

◆ ~Allocator()

template<class TYPE >
SAMRAI::tbox::Array< TYPE >::Allocator::~Allocator ( )
inline

Member Function Documentation

◆ get_block_id()

template<class TYPE >
static std::size_t SAMRAI::tbox::Array< TYPE >::Allocator::get_block_id ( const std::size_t  block_size)
inlinestaticprivate

◆ operator=()

template<class TYPE >
Allocator& SAMRAI::tbox::Array< TYPE >::Allocator::operator= ( const Allocator )
delete

◆ getAllocator()

template<class TYPE >
static Allocator& SAMRAI::tbox::Array< TYPE >::Allocator::getAllocator ( )
inlinestatic

◆ getNumberOfAllocations()

template<class TYPE >
static std::size_t SAMRAI::tbox::Array< TYPE >::Allocator::getNumberOfAllocations ( )
inlinestatic

◆ allocate()

template<class TYPE >
TYPE* SAMRAI::tbox::Array< TYPE >::Allocator::allocate ( const std::size_t  block_size)
inline

Return a block of memory with enough space for block_size elements of type TYPE. This block may either be newly allocated (via std::malloc()) or taken from a pool of previously allocated data.

This function is not static to ensure it is only called after Allocator() called.

◆ deallocate()

template<class TYPE >
static void SAMRAI::tbox::Array< TYPE >::Allocator::deallocate ( TYPE *const  block,
const std::size_t  block_size 
)
inlinestatic

Return an allocated block to the allocator.

This function is static since it may be run after ~Allocator() is run.

Member Data Documentation

◆ s_is_available

template<class TYPE >
bool SAMRAI::tbox::Array< TYPE >::Allocator::s_is_available
staticprivate

◆ s_number_of_allocations

template<class TYPE >
std::size_t SAMRAI::tbox::Array< TYPE >::Allocator::s_number_of_allocations
staticprivate

◆ s_block_stacks

template<class TYPE >
std::vector<std::vector<TYPE *> > SAMRAI::tbox::Array< TYPE >::Allocator::s_block_stacks
staticprivate

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