+/* Copyright (c) 2013-2014. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
fprintf(stdout, "Scheduling DAX...\n");
scheduleDAX(dax);
fprintf(stdout, "DAX scheduled\n");
- SD_simulate(-1);
+ xbt_dynar_t ret = SD_simulate(-1);
+ xbt_dynar_free(&ret);
fprintf(stdout, "Simulation end. Time: %f\n", SD_get_clock());
return dax;
*/
static void garbageCollector(xbt_dynar_t dax)
{
- SD_task_t task;
- unsigned int cursor;
- xbt_dynar_foreach(dax, cursor, task) {
+ while (!xbt_dynar_is_empty(dax)) {
+ SD_task_t task = xbt_dynar_pop_as(dax, SD_task_t);
SD_task_destroy(task);
}
+ xbt_dynar_free(&dax);
SD_exit();
}