- object = m->objects[--m->current_size];
- } else {
- /* otherwise we must allocate a new object */
- /* DEBUG3("Create a new object for mallocator %p (size:%d/%d)", m,
+ int i;
+ int amount=MIN( (m->max_size) /2,1000);
+ for (i=0;i<amount;i++)
+ m->objects[i] = (*(m->new_f)) ();
+ m->current_size=amount;
+ }
+
+ /* there is at least an available object, now */
+ /* XBT_DEBUG("Reuse an old object for mallocator %p (size:%d/%d)", m,