Gobelijn API documentation
- generated for commit a0cbea7
|
A memory pool that uses the pointer-to-implementation idiom under the hood. More...
#include <MemoryPool.h>
Public Member Functions | |
MemoryPool ()=delete | |
MemoryPool (const MemoryPool &)=delete | |
MemoryPool (MemoryPool &&)=delete | |
MemoryPool & | operator= (const MemoryPool &)=delete |
MemoryPool & | operator= (MemoryPool &&)=delete |
MemoryPool (size_t capacity) | |
Creates a memory pool that can allocate at least as many bytes as specified by the given capacity. More... | |
~MemoryPool () | |
Frees this memory pool's resources, if any. More... | |
template<typename T > | |
T * | Allocate (size_t size=1) |
Allocates a region of memory that is 'size * sizeof(T)' of bytes in size. More... | |
Private Member Functions | |
char * | AllocateMemory (size_t size) |
Allocates a region of memory that is the given number of bytes in size. More... | |
Private Attributes | |
std::unique_ptr< MemoryPoolImpl > | m_impl |
Fortunately, we don't need a definition to create a pointer to MemoryPoolImpl, so that's exactly what we'll do. More... | |
A memory pool that uses the pointer-to-implementation idiom under the hood.
This allows developers to switch MemoryPool implementation without re-compiling any other files.
Definition at line 30 of file MemoryPool.h.
|
delete |
|
delete |
|
delete |
Pimpl::MemoryPool::MemoryPool | ( | size_t | capacity | ) |
Creates a memory pool that can allocate at least as many bytes as specified by the given capacity.
Creates a memory pool that has at least the given capacity.
Definition at line 36 of file array-impl.cpp.
Pimpl::MemoryPool::~MemoryPool | ( | ) |
Frees this memory pool's resources, if any.
Definition at line 41 of file array-impl.cpp.
References m_impl.
|
delete |
|
delete |
|
inline |
Allocates a region of memory that is 'size * sizeof(T)' of bytes in size.
It fits exactly 'size' instances of 'T'.
Definition at line 50 of file MemoryPool.h.
References AllocateMemory().
Referenced by main().
|
private |
Allocates a region of memory that is the given number of bytes in size.
Definition at line 51 of file array-impl.cpp.
References m_impl.
Referenced by Allocate().
|
private |
Fortunately, we don't need a definition to create a pointer to MemoryPoolImpl, so that's exactly what we'll do.
Definition at line 60 of file MemoryPool.h.
Referenced by AllocateMemory(), and ~MemoryPool().