Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[simix] Use std::string for s_smx_process_arg
[simgrid.git] / src / simix / smx_host.cpp
index 985bdcd..ce5d2a6 100644 (file)
@@ -165,8 +165,7 @@ void _SIMIX_host_free_process_arg(void *data)
   for (int i = 0; i < arg->argc; i++)
     xbt_free(arg->argv[i]);
   xbt_free(arg->argv);
-  xbt_free(arg->name);
-  xbt_free(arg);
+  delete arg;
 }
 /**
  * \brief Add a process to the list of the processes that the host will restart when it comes back
@@ -188,8 +187,8 @@ void SIMIX_host_add_auto_restart_process(sg_host_t host,
   if (!sg_host_simix(host)->auto_restart_processes) {
     sg_host_simix(host)->auto_restart_processes = xbt_dynar_new(sizeof(smx_process_arg_t),_SIMIX_host_free_process_arg);
   }
-  smx_process_arg_t arg = xbt_new(s_smx_process_arg_t,1);
-  arg->name = xbt_strdup(name);
+  smx_process_arg_t arg = new s_smx_process_arg_t();
+  arg->name = name;
   arg->code = code;
   arg->data = data;
   arg->hostname = hostname;