SimGrid
3.18
Versatile Simulation of Distributed Systems
|
Typedefs | |
typedef struct s_xbt_mallocator * | xbt_mallocator_t |
Mallocator data type (opaque structure) More... | |
Functions | |
xbt_mallocator_t | xbt_mallocator_new (int size, pvoid_f_void_t new_f, void_f_pvoid_t free_f, void_f_pvoid_t reset_f) |
Constructor. More... | |
void | xbt_mallocator_free (xbt_mallocator_t mallocator) |
Destructor. More... | |
typedef struct s_xbt_mallocator* xbt_mallocator_t |
Mallocator data type (opaque structure)
xbt_mallocator_t xbt_mallocator_new | ( | int | size, |
pvoid_f_void_t | new_f, | ||
void_f_pvoid_t | free_f, | ||
void_f_pvoid_t | reset_f | ||
) |
Constructor.
size | size of the internal stack: number of objects the mallocator will be able to store |
new_f | function to allocate a new object of your datatype, called in xbt_mallocator_get() when the mallocator is empty |
free_f | function to free an object of your datatype, called in xbt_mallocator_release() when the stack is full, and when the mallocator is freed. |
reset_f | function to reinitialise an object of your datatype, called when you extract an object from the mallocator (can be NULL) |
Create and initialize a new mallocator for a given datatype.
void xbt_mallocator_free | ( | xbt_mallocator_t | m | ) |
Destructor.
m | the mallocator you want to destroy |
Destroy the mallocator and all its data. The function free_f is called on each object in the mallocator.