Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of git+ssh://scm.gforge.inria.fr//gitroot//simgrid/simgrid
[simgrid.git] / examples / simdag / sd_seq_access.c
index 786ce22..01b0433 100644 (file)
@@ -86,7 +86,7 @@ int main(int argc, char **argv)
                    &(computation_amount[1]), SD_SCHED_NO_COST, rate);
 
   /* let's launch the simulation! */
-  while (xbt_dynar_length(changed_tasks = SD_simulate(-1.0)) > 0) {
+  while (!xbt_dynar_is_empty(changed_tasks = SD_simulate(-1.0))) {
     for (i = 0; i < 2; i++) {
       task = SD_workstation_get_current_task(workstations[i]);
       if (task)
@@ -116,8 +116,9 @@ int main(int argc, char **argv)
         XBT_ERROR("Shouldn't be here");
       }
     }
-    xbt_dynar_free_container(&changed_tasks);
+    xbt_dynar_free(&changed_tasks);
   }
+  xbt_dynar_free(&changed_tasks);
 
   XBT_DEBUG("Destroying tasks...");