Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
try to clean and uniformize Activity Impls
[simgrid.git] / src / simix / libsmx.cpp
index df3df95..9947bf1 100644 (file)
@@ -384,11 +384,9 @@ smx_activity_t simcall_execution_start(const std::string& name, const std::strin
                                        double priority, double bound, sg_host_t host)
 {
   return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
                                        double priority, double bound, sg_host_t host)
 {
   return simgrid::simix::simcall([name, category, flops_amount, priority, bound, host] {
-    return simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl())
-        ->set_name(name)
-        ->set_tracing_category(category)
-        ->set_host(host)
-        ->start(flops_amount, priority, bound);
+    simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
+    (*exec).set_name(name).set_tracing_category(category).set_host(host).start(flops_amount, priority, bound);
+    return simgrid::kernel::activity::ExecImplPtr(exec);
   });
 }
 
   });
 }
 
@@ -425,10 +423,9 @@ smx_activity_t simcall_execution_parallel_start(const std::string& name, int hos
   if (bytes_amount != nullptr)
     bytes_parallel_amount = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
   return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
   if (bytes_amount != nullptr)
     bytes_parallel_amount = std::vector<double>(bytes_amount, bytes_amount + host_nb * host_nb);
   return simgrid::simix::simcall([name, hosts, flops_parallel_amount, bytes_parallel_amount, timeout] {
-    return simgrid::kernel::activity::ExecImplPtr(new simgrid::kernel::activity::ExecImpl())
-        ->set_name(name)
-        ->set_timeout(timeout)
-        ->start(hosts, flops_parallel_amount, bytes_parallel_amount);
+    simgrid::kernel::activity::ExecImpl* exec = new simgrid::kernel::activity::ExecImpl();
+    (*exec).set_name(name).set_timeout(timeout).start(hosts, flops_parallel_amount, bytes_parallel_amount);
+    return simgrid::kernel::activity::ExecImplPtr(exec);
   });
 }
 
   });
 }