Nektar++
|
#include <ThreadSpecificPool.hpp>
Public Types | |
typedef std::map< size_t, std::shared_ptr< detail::ThreadSpecificPool > > | PoolMapType |
Public Member Functions | |
MemPool () | |
~MemPool () | |
void * | Allocate (size_t bytes) |
Allocate a block of memory of size ByteSize. More... | |
void | Deallocate (void *p, size_t bytes) |
Deallocate memory claimed by an earlier call to allocate. More... | |
Private Attributes | |
detail::ThreadSpecificPool | m_fourBytePool |
std::map< size_t, std::shared_ptr< detail::ThreadSpecificPool > > | m_pools |
size_t | m_upperBound |
Definition at line 150 of file ThreadSpecificPool.hpp.
typedef std::map<size_t, std::shared_ptr<detail::ThreadSpecificPool> > Nektar::MemPool::PoolMapType |
Definition at line 154 of file ThreadSpecificPool.hpp.
|
inline |
Definition at line 157 of file ThreadSpecificPool.hpp.
References m_pools.
|
inline |
Definition at line 190 of file ThreadSpecificPool.hpp.
|
inline |
Allocate a block of memory of size ByteSize.
std::bad_alloc | if memory is exhausted. |
bytes | The number of bytes to allocate. |
If the bytes parameter specifies a size that is handled by memory pools then the memory is allocated from the pool. Otherwise the memory is allocated with a call to new.
Important: All memory allocated from this method must be returned to the pool via the Deallocate method. Deleting pointers allocated from the memory pool with the delete operator will result in undefined behavior.
Definition at line 205 of file ThreadSpecificPool.hpp.
References Nektar::detail::ThreadSpecificPool::Allocate(), ASSERTL1, m_fourBytePool, m_pools, and m_upperBound.
Referenced by Nektar::MemoryManager< DataType >::RawAllocate().
Deallocate memory claimed by an earlier call to allocate.
Definition at line 235 of file ThreadSpecificPool.hpp.
References ASSERTL1, Nektar::detail::ThreadSpecificPool::Deallocate(), m_fourBytePool, m_pools, m_upperBound, and CellMLToNektar.cellml_metadata::p.
Referenced by Nektar::MemoryManager< DataType >::Deallocate(), and Nektar::MemoryManager< DataType >::RawDeallocate().
|
private |
Definition at line 261 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), and Deallocate().
|
private |
Definition at line 262 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), Deallocate(), and MemPool().
|
private |
Definition at line 263 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), and Deallocate().