LILAC
|
This provides a class to assisst with memory management. More...
#include <mempool.hpp>
Public Member Functions | |
template<class... Tl> | |
void | create (size_t dim, Tl *restr *...args) |
Creates memory pool with alignment of 32 bytes. | |
template<class... Tl> | |
void | create (size_t mal, size_t dim, Tl *restr *...args) |
Creates memory pool with specified alignment. | |
template<class... Tl> | |
void | add (size_t mal, size_t dim, Tl *restr *...args) |
template<class... Tl> | |
void | add (size_t dim, Tl *restr *...args) |
void | set_dim (size_t num, size_t mal=32) |
Resets the dimension and alignment of the pool. | |
void | clear () |
Clears the memory pool and deallocates the memory. | |
mempool () | |
~mempool () |
Private Member Functions | |
template<class... Tl> | |
void | make_this (size_t mal, size_t dim, Tl *restr *...args) |
template<class... Tl> | |
void | make_this (size_t dim, Tl *restr *...args) |
Static Private Member Functions | |
static void | _create (size_t al, char *v, char *en, std::list< size_t > sizes, std::list< size_t > vsizes, std::list< char * > &ptrl) |
Private Attributes | |
char * | izard |
size_t | total_bytes |
std::list< size_t > | csizes |
std::list< size_t > | vsizes |
std::list< void ** > | cptrs |
This provides a class to assisst with memory management.
This class helps with allocating memory for use in computations. It creates a list of pointers that are all aligned to a specified value and are near each other in memory
Definition at line 80 of file mempool.hpp.
mempool::mempool | ( | ) |
Definition at line 92 of file mempool.cpp.
mempool::~mempool | ( | ) |
Definition at line 94 of file mempool.cpp.
|
staticprivate |
void mempool::add | ( | size_t | mal, |
size_t | dim, | ||
Tl *restr *... | args | ||
) |
Adds new pointers to the memory pool, with an alignment of 32 bytes
Adds new pointers to the existing memory pool, with a dimension of dim. This can be different than the previous dimensions, and will not affect previously entered pointers
mal | The alignment in bytes |
dim | The dimension of each pointer |
args | The addresses of the pointers |
Definition at line 203 of file mempool.hpp.
|
inline |
void mempool::clear | ( | ) |
Clears the memory pool and deallocates the memory.
Definition at line 81 of file mempool.cpp.
|
inline |
Creates memory pool with alignment of 32 bytes.
Creates a memory pool with an alignment of 32 bytes, and sets each pointer to its respective position.
dim | the length of each pointer |
args | the address of each pointer |
Definition at line 105 of file mempool.hpp.
|
inline |
Creates memory pool with specified alignment.
Creates a memory pool with specified alignment, and sets each pointer to its respective position.
dim | the length of each pointer |
args | the address of each pointer |
mal | The alignment in bytes |
Definition at line 117 of file mempool.hpp.
|
private |
Performs the creation of the memory pool, with alignment mal, length dim, and types Tl...
mal | The alignment in bytes |
dim | the dimension of the pointers |
args | the addresses of each pointer |
Definition at line 153 of file mempool.hpp.
|
inlineprivate |
void mempool::set_dim | ( | size_t | num, |
size_t | mal = 32 |
||
) |
Resets the dimension and alignment of the pool.
Sets the dimension and alignment of each pointer in the memory pool
num | New dimension of the memory pool |
mal | Alignment of the pointers |
Definition at line 19 of file mempool.cpp.
|
private |
Definition at line 89 of file mempool.hpp.
|
private |
Definition at line 88 of file mempool.hpp.
|
private |
Charizard is the third evolution of flame pokemon charmander. Very powerful and difficult to tame. Also known for it's ability to store the raw memory used in memory pools
Definition at line 86 of file mempool.hpp.
|
private |
Definition at line 87 of file mempool.hpp.
|
private |
Definition at line 88 of file mempool.hpp.