Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
added code and tesh files for ns3 wifi example
[simgrid.git] / examples / s4u / comm-dependent / s4u-comm-dependent.cpp
index 0e5f9baa18a79cbf0ebcec4ec737b64bb929f175..b1add65cf3b4f1c1f8bda64ee7a4e9bf6b540347 100644 (file)
@@ -9,8 +9,7 @@ XBT_LOG_NEW_DEFAULT_CATEGORY(s4u_comm_dependent, "Messages specific for this s4u
 
 static void sender(simgrid::s4u::Mailbox* mailbox)
 {
-  double* computation_amount = new double();
-  *computation_amount        = simgrid::s4u::this_actor::get_host()->get_speed();
+  auto* computation_amount   = new double(simgrid::s4u::this_actor::get_host()->get_speed());
   simgrid::s4u::ExecPtr exec = simgrid::s4u::this_actor::exec_init(2 * (*computation_amount));
   simgrid::s4u::CommPtr comm = mailbox->put_init(computation_amount, 7e6);