UMPIRE
Umpire: resource management and provision
umpire::util::FixedMallocPool Class Reference

Pool for fixed size allocations using malloc() More...

#include </home/docs/checkouts/readthedocs.org/user_builds/umpire/checkouts/develop/src/umpire/util/FixedMallocPool.hpp>

Public Member Functions

 FixedMallocPool ()=delete
 
 FixedMallocPool (const std::size_t object_bytes, const std::size_t objects_per_pool=1024 *1024)
 
 FixedMallocPool (const FixedMallocPool &other)=delete
 
FixedMallocPooloperator= (const FixedMallocPool &other)=delete
 
 ~FixedMallocPool ()
 
void * allocate (std::size_t bytes=0)
 
void deallocate (void *ptr)
 
std::size_t numPools () const noexcept
 
std::size_t totalBytes () const noexcept
 

Detailed Description

Pool for fixed size allocations using malloc()

Another version of this class exists in umpire::strategy, but this version does not rely on Allocator and all the memory tracking statistics, so it is useful for building objects in umpire::util.

Constructor & Destructor Documentation

◆ FixedMallocPool() [1/3]

umpire::util::FixedMallocPool::FixedMallocPool ( )
delete

◆ FixedMallocPool() [2/3]

umpire::util::FixedMallocPool::FixedMallocPool ( const std::size_t  object_bytes,
const std::size_t  objects_per_pool = 1024 * 1024 
)

◆ FixedMallocPool() [3/3]

umpire::util::FixedMallocPool::FixedMallocPool ( const FixedMallocPool other)
delete

◆ ~FixedMallocPool()

umpire::util::FixedMallocPool::~FixedMallocPool ( )

References umpire::free().

Member Function Documentation

◆ operator=()

FixedMallocPool& umpire::util::FixedMallocPool::operator= ( const FixedMallocPool other)
delete

◆ allocate()

void * umpire::util::FixedMallocPool::allocate ( std::size_t  bytes = 0)

◆ deallocate()

void umpire::util::FixedMallocPool::deallocate ( void *  ptr)

◆ numPools()

std::size_t umpire::util::FixedMallocPool::numPools ( ) const
noexcept

Referenced by totalBytes().

◆ totalBytes()

std::size_t umpire::util::FixedMallocPool::totalBytes ( ) const
noexcept