Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Use method get() instead of &* for intrusive_ptr.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 20 Nov 2017 09:30:09 +0000 (10:30 +0100)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Mon, 20 Nov 2017 09:30:09 +0000 (10:30 +0100)
src/mc/mc_request.cpp
src/simix/popping_private.hpp
src/simix/smx_network.cpp
src/simix/smx_synchro.cpp

index 6a800b7..c07f4ff 100644 (file)
@@ -324,7 +324,7 @@ std::string simgrid::mc::request_to_string(smx_simcall_t req, int value, simgrid
       read_element(mc_model_checker->process(),
         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
         sizeof(remote_sync));
       read_element(mc_model_checker->process(),
         &remote_sync, remote(simcall_comm_waitany__get__comms(req)), value,
         sizeof(remote_sync));
-      char* p = pointer_to_string(&*remote_sync);
+      char* p = pointer_to_string(remote_sync.get());
       args = bprintf("comm=%s (%d of %lu)",
         p, value + 1, xbt_dynar_length(&comms));
       xbt_free(p);
       args = bprintf("comm=%s (%d of %lu)",
         p, value + 1, xbt_dynar_length(&comms));
       xbt_free(p);
index e0c200a..b7d4b5f 100644 (file)
@@ -143,8 +143,8 @@ inline void marshal(type<boost::intrusive_ptr<T>>, u_smx_scalar& simcall, boost:
   if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr...
     simcall.dp = nullptr;
   } else {
   if (value.get() == nullptr) { // Sometimes we return nullptr in an intrusive_ptr...
     simcall.dp = nullptr;
   } else {
-    intrusive_ptr_add_ref(&*value);
-    simcall.dp = static_cast<void*>(&*value);
+    intrusive_ptr_add_ref(value.get());
+    simcall.dp = static_cast<void*>(value.get());
   }
 }
 template <class T> inline boost::intrusive_ptr<T> unmarshal(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
   }
 }
 template <class T> inline boost::intrusive_ptr<T> unmarshal(type<boost::intrusive_ptr<T>>, u_smx_scalar const& simcall)
index fde74d4..173e0af 100644 (file)
@@ -318,7 +318,7 @@ void simcall_HANDLER_comm_wait(smx_simcall_t simcall, smx_activity_t synchro, do
   } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
               fails */
     surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
   } else { /* we need a surf sleep action even when there is no timeout, otherwise surf won't tell us when the host
               fails */
     surf_action_t sleep = simcall->issuer->host->pimpl_cpu->sleep(timeout);
-    sleep->setData(&*synchro);
+    sleep->setData(synchro.get());
 
     simgrid::kernel::activity::CommImplPtr comm =
         boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
 
     simgrid::kernel::activity::CommImplPtr comm =
         boost::static_pointer_cast<simgrid::kernel::activity::CommImpl>(synchro);
index 6194069..e25a227 100644 (file)
@@ -29,7 +29,7 @@ static smx_activity_t SIMIX_synchro_wait(sg_host_t smx_host, double timeout)
   simgrid::kernel::activity::RawImplPtr sync =
       simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
   sync->sleep                          = smx_host->pimpl_cpu->sleep(timeout);
   simgrid::kernel::activity::RawImplPtr sync =
       simgrid::kernel::activity::RawImplPtr(new simgrid::kernel::activity::RawImpl());
   sync->sleep                          = smx_host->pimpl_cpu->sleep(timeout);
-  sync->sleep->setData(&*sync);
+  sync->sleep->setData(sync.get());
   XBT_OUT();
   return sync;
 }
   XBT_OUT();
   return sync;
 }