SimGrid 3.6.2
Scalable simulation of distributed systems
Functions
Mallocator object handling
Mallocators

Functions

void * xbt_mallocator_get (xbt_mallocator_t mallocator)
 Extract an object from a mallocator.
void xbt_mallocator_release (xbt_mallocator_t mallocator, void *object)
 Push an object into a mallocator.

Function Documentation

void* xbt_mallocator_get ( xbt_mallocator_t  m)

Extract an object from a mallocator.

Parameters:
ma mallocator

Remove an object from the mallocator and return it. This function is designed to be used instead of malloc(). If the mallocator is not empty, an object is extracted from the mallocator and no malloc is done.

If the mallocator is empty, a new object is created, by calling the function new_f().

In both cases, the function reset_f() is called on the object.

See also:
xbt_mallocator_release()
void xbt_mallocator_release ( xbt_mallocator_t  m,
void *  object 
)

Push an object into a mallocator.

Parameters:
ma mallocator
objectan object you don't need anymore

Push into the mallocator an object you don't need anymore. This function is designed to be used instead of free(). If the mallocator is not full, your object if stored into the mallocator and no free is done. If the mallocator is full, the object is freed by calling the function free_f().

See also:
xbt_mallocator_get()


Back to the main Simgrid Documentation page The version of Simgrid documented here is v3.6.2.
Documentation of other versions can be found in their respective archive files (directory doc/html).
Generated for SimGridAPI by doxygen