mCRL2
|
#include <simple_list.h>
Classes | |
class | pool_block_t |
Public Member Functions | |
my_pool () | |
constructor | |
~my_pool () | |
destructor | |
template<class U , class... Args> | |
U * | construct (Args &&... args) |
allocate and construct a new element (of any type) | |
template<class U > | |
void | destroy (U *const old_el) |
destroy and delete some element | |
Private Member Functions | |
template<class U , class... Args> | |
U * | construct_samesize (Args &&... args) |
allocate and construct a new element of the same size as the free list | |
template<class U , class... Args> | |
U * | construct_othersize (Args &&... args) |
allocate and construct a new element of a size that doesn't fit the free list | |
Static Private Member Functions | |
static void *& | deref_void (void *addr) |
Private Attributes | |
pool_block_t * | first_block |
first chunk in list of chunks | |
void * | begin_used_in_first_block |
start of part in the first chunk that is already in use | |
void * | first_free_T |
first freed element | |
Definition at line 111 of file simple_list.h.
|
inline |
constructor
Definition at line 141 of file simple_list.h.
|
inline |
destructor
Definition at line 150 of file simple_list.h.
|
inline |
allocate and construct a new element (of any type)
Definition at line 244 of file simple_list.h.
|
inlineprivate |
allocate and construct a new element of a size that doesn't fit the free list
Definition at line 197 of file simple_list.h.
|
inlineprivate |
allocate and construct a new element of the same size as the free list
Definition at line 167 of file simple_list.h.
|
inlinestaticprivate |
Definition at line 135 of file simple_list.h.
|
inline |
destroy and delete some element
destroy() is only allowed if the destructor of U is trivial. This ensures that in my_pool::~my_pool() we do not have to test whether some element has been freed before we destroy it. Also, the size of U has to be the same size as the size of T, so each entry in the free list has the same size.
Definition at line 264 of file simple_list.h.
|
private |
start of part in the first chunk that is already in use
Definition at line 130 of file simple_list.h.
|
private |
first chunk in list of chunks
All chunks except the first one are completely in use.
Definition at line 127 of file simple_list.h.
|
private |
first freed element
Definition at line 133 of file simple_list.h.