Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Usage of xbt_new0 instead calloc
[simgrid.git] / examples / msg / masterslave / masterslave_bypass.c
index 10d40ec..5769ff6 100644 (file)
@@ -197,7 +197,7 @@ int master(int argc, char *argv[])
   {                  /*  Task creation */
     char sprintf_buffer[64];
 
-    todo = calloc(number_of_tasks, sizeof(m_task_t));
+    todo = xbt_new0(m_task_t,number_of_tasks);
 
     for (i = 0; i < number_of_tasks; i++) {
       sprintf(sprintf_buffer, "Task_%d", i);
@@ -207,7 +207,7 @@ int master(int argc, char *argv[])
 
   {                  /* Process organisation */
     slaves_count = argc - 4;
-    slaves = calloc(slaves_count, sizeof(m_host_t));
+    slaves = xbt_new0(m_host_t,slaves_count);
     
     for (i = 4; i < argc; i++) {
       slaves[i-4] = MSG_get_host_by_name(argv[i]);