Nektar++
|
#include <ThreadSpecificPool.hpp>
Public Types | |
typedef std::map< size_t, boost::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, boost::shared_ptr< detail::ThreadSpecificPool > > | m_pools |
size_t | m_upperBound |
Definition at line 142 of file ThreadSpecificPool.hpp.
typedef std::map<size_t, boost::shared_ptr<detail::ThreadSpecificPool> > Nektar::MemPool::PoolMapType |
Definition at line 145 of file ThreadSpecificPool.hpp.
|
inline |
Definition at line 148 of file ThreadSpecificPool.hpp.
References m_pools.
|
inline |
Definition at line 169 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 183 of file ThreadSpecificPool.hpp.
References Nektar::detail::ThreadSpecificPool::Allocate(), ASSERTL1, Nektar::iterator, 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 207 of file ThreadSpecificPool.hpp.
References ASSERTL1, Nektar::detail::ThreadSpecificPool::Deallocate(), Nektar::iterator, m_fourBytePool, m_pools, and m_upperBound.
Referenced by Nektar::MemoryManager< DataType >::Deallocate(), and Nektar::MemoryManager< DataType >::RawDeallocate().
|
private |
Definition at line 228 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), and Deallocate().
|
private |
Definition at line 229 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), Deallocate(), and MemPool().
|
private |
Definition at line 230 of file ThreadSpecificPool.hpp.
Referenced by Allocate(), and Deallocate().