|
dispenso 1.4.1
A library for task parallelism
|
#include <pool_allocator.h>
Public Member Functions | |
| DISPENSO_DLL_ACCESS | PoolAllocatorT (size_t chunkSize, size_t allocSize, std::function< void *(size_t)> allocFunc, std::function< void(void *)> deallocFunc) |
| DISPENSO_DLL_ACCESS void | clear () |
| size_t | totalChunkCapacity () const |
| DISPENSO_DLL_ACCESS | ~PoolAllocatorT () |
A pool allocator to help reduce calls to the underlying allocation and deallocation functions.
Definition at line 30 of file pool_allocator.h.
| DISPENSO_DLL_ACCESS dispenso::PoolAllocatorT< kThreadSafe >::PoolAllocatorT | ( | size_t | chunkSize, |
| size_t | allocSize, | ||
| std::function< void *(size_t)> | allocFunc, | ||
| std::function< void(void *)> | deallocFunc ) |
Construct a PoolAllocator.
| chunkSize | The chunk size for each pool allocation |
| allocSize | The size of underlying slabs to be chunked |
| allocFunc | The underlying allocation function for allocating slabs |
| deallocFunc | The underlying deallocation function. Currently only called on destruction. |
| DISPENSO_DLL_ACCESS dispenso::PoolAllocatorT< kThreadSafe >::~PoolAllocatorT | ( | ) |
Destruct a PoolAllocator
| DISPENSO_DLL_ACCESS void dispenso::PoolAllocatorT< kThreadSafe >::clear | ( | ) |
Effectively dealloc all previously allocated chunks. Useful for arenas. This function is not thread safe, and no previously allocated chunks may be dealloc'd after clear.
|
inline |
Get the total capicity allocated in chunks (how many alloc() could be called without triggering allocFunc() if all chunks were available)
Definition at line 71 of file pool_allocator.h.