]> AND Public Git Repository - simgrid.git/blobdiff - src/simix/SynchroExec.cpp
Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of scm.gforge.inria.fr:/gitroot/simgrid/simgrid
[simgrid.git] / src / simix / SynchroExec.cpp
index ddd7fc9712a46f79162fa59e441db84e95de7867..99d2b74fa2c41f302b10e3bf700061c94b1ddf87 100644 (file)
@@ -9,10 +9,12 @@
 
 simgrid::simix::Exec::Exec(const char*name, sg_host_t hostarg)
 {
-  name = xbt_strdup(name);
-  state = SIMIX_RUNNING;
-  host = hostarg;
+  if (name)
+    this->name = name;
+  this->state = SIMIX_RUNNING;
+  this->host = hostarg;
 }
+
 simgrid::simix::Exec::~Exec()
 {
   if (surf_exec)
@@ -53,10 +55,10 @@ void simgrid::simix::Exec::post()
 
   if (surf_exec) {
     surf_exec->unref();
-    surf_exec = NULL;
+    surf_exec = nullptr;
   }
 
   /* If there are simcalls associated with the synchro, then answer them */
-  if (xbt_fifo_size(simcalls))
+  if (!simcalls.empty())
     SIMIX_execution_finish(this);
 }