#include <pool.h>
Inherits RandomSizedMemoryPool< char >.
Public Member Functions | |
| VoidPool (size_t block_size) throw () | |
| Constructor initializes new pool, but does not allocate any memory. | |
| virtual | ~VoidPool (void) throw () |
| Destroys the pool, deallocate all blocks. | |
| virtual void * | get_raw_memory (size_t mem_size) |
| Returns pointer to free memory of size `mem_size`. | |
| ace::VoidPool::VoidPool | ( | size_t | block_size | ) | throw () [inline] |
Constructor initializes new pool, but does not allocate any memory.
| block_size | Size of the pool (in sizeof(chars)). |
| virtual ace::VoidPool::~VoidPool | ( | void | ) | throw () [inline, virtual] |
Destroys the pool, deallocate all blocks.
| virtual void* ace::VoidPool::get_raw_memory | ( | size_t | mem_size | ) | [inline, virtual] |
Returns pointer to free memory of size `mem_size`.
If `mem_size` is bigger than size of memory blocks within the pool, NULL is returned. Moreover if there is not enough memory and new memory cannot be allocated, function throws std::bad_alloc.
| mem_size | The size of demanded memory. |
| std::bad_alloc | When there is no more memory available. |
1.5.6