Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of https://framagit.org/simgrid/simgrid
[simgrid.git] / examples / c / exec-waitany / exec-waitany.c
index 7f65a20..a8a5780 100644 (file)
@@ -19,19 +19,19 @@ static void worker(int argc, char* argv[])
   int with_timeout = !strcmp(argv[1], "true");
 
   /* Vector in which we store all pending executions*/
-  sg_exec_t* pending_execs = malloc(sizeof(sg_exec_t) * 3);
+  sg_exec_t* pending_execs = xbt_malloc(sizeof(sg_exec_t) * 3);
   int pending_execs_count  = 0;
 
   for (int i = 0; i < 3; i++) {
     char* name    = bprintf("Exec-%d", i);
-    double amount = (6 * (i % 2) + i + 1) * sg_host_speed(sg_host_self());
+    double amount = (6 * (i % 2) + i + 1) * sg_host_get_speed(sg_host_self());
 
     sg_exec_t exec = sg_actor_exec_init(amount);
     sg_exec_set_name(exec, name);
     pending_execs[pending_execs_count++] = exec;
     sg_exec_start(exec);
 
-    XBT_INFO("Activity %s has started for %.0f seconds", name, amount / sg_host_speed(sg_host_self()));
+    XBT_INFO("Activity %s has started for %.0f seconds", name, amount / sg_host_get_speed(sg_host_self()));
     free(name);
   }