In contrary to regular dicts, the key is not malloced before copy.
Mixing scalar and regular elements in the same dict is not tested
(but may work).
+ * Allow to use xbt_dynar_shrink() to expend the dynar instead
Tracing for Visualization:
* SimGrid is now instrumented in order to generate a trace file for
visualization analysis: to use it, need to compile SimGrid with the
* Set \a empty_slots_wanted to zero to reduce the dynar internal array as much
* as possible.
* Note that if \a empty_slots_wanted is greater than the array size, the internal
- * array is not expanded and nothing is done.
+ * array is expanded instead of shriked.
*/
void xbt_dynar_shrink(xbt_dynar_t dynar, int empty_slots_wanted)
{
_dynar_lock(dynar);
size_wanted = dynar->used + empty_slots_wanted;
- if (size_wanted < dynar->size) {
+ if (size_wanted != dynar->size) {
dynar->size = size_wanted;
dynar->data = xbt_realloc(dynar->data, sizeof(void *) * dynar->size);
}