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 147 of file ThreadSpecificPool.hpp.
typedef std::map<size_t, std::shared_ptr<detail::ThreadSpecificPool> > Nektar::MemPool::PoolMapType |
Definition at line 150 of file ThreadSpecificPool.hpp.
|
inline |
Definition at line 153 of file ThreadSpecificPool.hpp.
|
inline |
Definition at line 174 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 188 of file ThreadSpecificPool.hpp.
References ASSERTL1.
Referenced by Nektar::MemoryManager< DataType >::Deallocate(), and Nektar::MemoryManager< DataType >::RawAllocate().
Deallocate memory claimed by an earlier call to allocate.
Definition at line 212 of file ThreadSpecificPool.hpp.
References ASSERTL1, and CellMLToNektar.cellml_metadata::p.
Referenced by Nektar::MemoryManager< DataType >::Deallocate(), and Nektar::MemoryManager< DataType >::RawDeallocate().
|
private |
Definition at line 233 of file ThreadSpecificPool.hpp.
|
private |
Definition at line 234 of file ThreadSpecificPool.hpp.
|
private |
Definition at line 235 of file ThreadSpecificPool.hpp.