Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
leak-- smell++ (C cast to avoid const_cast)
[simgrid.git] / examples / simdag / test / sd_test.cpp
index 37066ff..bef939b 100644 (file)
@@ -27,7 +27,7 @@ int main(int argc, char **argv)
   SD_create_environment(argv[1]);
 
   /* test the estimation functions */
-  const sg_host_t *hosts = sg_host_list();
+  const sg_host_t* hosts           = sg_host_list();
   simgrid::s4u::Host* h1           = hosts[4];
   simgrid::s4u::Host* h2           = hosts[2];
   double comp_amount1 = 2000000;
@@ -38,7 +38,7 @@ int main(int argc, char **argv)
   XBT_INFO("Computation time for %f flops on %s: %f", comp_amount2, h2->cname(), comp_amount2/h2->speed());
 
   XBT_INFO("Route between %s and %s:", h1->cname(), h2->cname());
-  std::vector<Link*> route;
+  std::vector<sg_link_t> route;
   double latency = 0;
   h1->routeTo(h2, &route, &latency);
 
@@ -141,5 +141,6 @@ int main(int argc, char **argv)
 
   XBT_DEBUG("Tasks destroyed. Exiting SimDag...");
   SD_exit();
+  xbt_free((sg_host_t*)hosts);
   return 0;
 }