mCRL2
|
The block allocator provides the allocator interface for the memory pool class. As such is can be used as an allocator for allocator aware storages. More...
#include <block_allocator.h>
Classes | |
struct | rebind |
Public Types | |
using | value_type = T |
using | size_type = std::size_t |
using | difference_type = std::ptrdiff_t |
Public Member Functions | |
block_allocator ()=default | |
T * | allocate (size_type n, const void *hint=nullptr) |
void | deallocate (T *p, size_type) |
block_allocator (block_allocator &&)=default | |
block_allocator & | operator= (block_allocator &&)=default |
Public Member Functions inherited from mcrl2::utilities::memory_pool< T, ElementsPerBlock, ThreadSafe > | |
memory_pool ()=default | |
~memory_pool () | |
Triggers the (possibly non-trivial) destructor of all elements stored in the pool. | |
T * | allocate () |
Reuses memory from block and allocates a new block when no slots are free. | |
void | deallocate (T *pointer) |
Free the memory used by the given pointer that has been allocated by this pool. | |
std::size_t | consolidate () |
Frees blocks that are no longer storing elements of T. | |
bool | has_free_slots () const noexcept |
std::size_t | capacity () const noexcept |
memory_pool (memory_pool &&other)=default | |
memory_pool & | operator= (memory_pool &&other)=default |
Private Types | |
using | super = memory_pool< T, ElementsPerBlock, ThreadSafe > |
The block allocator provides the allocator interface for the memory pool class. As such is can be used as an allocator for allocator aware storages.
Also provides several non-standard allocate functions specifically for the term pool.
Definition at line 29 of file block_allocator.h.
using mcrl2::utilities::block_allocator< T, ElementsPerBlock, ThreadSafe >::difference_type = std::ptrdiff_t |
Definition at line 37 of file block_allocator.h.
using mcrl2::utilities::block_allocator< T, ElementsPerBlock, ThreadSafe >::size_type = std::size_t |
Definition at line 36 of file block_allocator.h.
|
private |
Definition at line 32 of file block_allocator.h.
using mcrl2::utilities::block_allocator< T, ElementsPerBlock, ThreadSafe >::value_type = T |
Definition at line 35 of file block_allocator.h.
|
default |
|
default |
|
inline |
The unused parameter is to make the interface equivalent to the allocator.
Definition at line 49 of file block_allocator.h.
|
inline |
The unused parameter is to make the interface equivalent to the allocator.
Definition at line 61 of file block_allocator.h.
|
default |