* in \a xbt_mallocator_release() when the stack is full, and when
* the mallocator is freed.
* \param reset_f function to reinitialise an object of your datatype, called
* in \a xbt_mallocator_release() when the stack is full, and when
* the mallocator is freed.
* \param reset_f function to reinitialise an object of your datatype, called
m = xbt_new0(s_xbt_mallocator_t, 1);
XBT_VERB("Create mallocator %p", m);
m = xbt_new0(s_xbt_mallocator_t, 1);
XBT_VERB("Create mallocator %p", m);
* If the mallocator is empty, a new object is created,
* by calling the function new_f().
*
* If the mallocator is empty, a new object is created,
* by calling the function new_f().
*
if (m->current_size <= 0) {
/* No object is ready yet. Create a bunch of them to try to group the
* mallocs on the same memory pages (to help the cache lines) */
if (m->current_size <= 0) {
/* No object is ready yet. Create a bunch of them to try to group the
* mallocs on the same memory pages (to help the cache lines) */
/* XBT_DEBUG("Reuse an old object for mallocator %p (size:%d/%d)", */
/* m, m->current_size, m->max_size); */
object = m->objects[--m->current_size];
/* XBT_DEBUG("Reuse an old object for mallocator %p (size:%d/%d)", */
/* m, m->current_size, m->max_size); */
object = m->objects[--m->current_size];