Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Const pointer/reference.
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 4 May 2021 09:18:17 +0000 (11:18 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 4 May 2021 12:18:15 +0000 (14:18 +0200)
src/kernel/actor/ActorImpl.cpp
src/s4u/s4u_Actor.cpp
src/surf/sg_platf.cpp

index e7e2b7f..06d324c 100644 (file)
@@ -230,7 +230,7 @@ void ActorImpl::exit()
     activities_.remove(waiting_synchro_);
     waiting_synchro_ = nullptr;
   }
-  for (auto& activity : activities_)
+  for (auto const& activity : activities_)
     activity->cancel();
   activities_.clear();
 
@@ -379,7 +379,7 @@ void ActorImpl::suspend()
   suspended_ = true;
 
   /* Suspend the activities associated with this actor. */
-  for (auto& activity : activities_)
+  for (auto const& activity : activities_)
     activity->suspend();
 }
 
@@ -397,7 +397,7 @@ void ActorImpl::resume()
   suspended_ = false;
 
   /* resume the activities that were blocked when suspending the actor. */
-  for (auto& activity : activities_)
+  for (auto const& activity : activities_)
     activity->resume();
   if (not waiting_synchro_) // Reschedule the actor if it was forcefully unscheduled in yield()
     simix_global->actors_to_run.push_back(this);
index 0528b71..2a640c4 100644 (file)
@@ -157,7 +157,7 @@ void Actor::set_host(Host* new_host)
   const s4u::Host* previous_location = get_host();
 
   kernel::actor::simcall([this, new_host]() {
-    for (auto& activity : pimpl_->activities_) {
+    for (auto const& activity : pimpl_->activities_) {
       // FIXME: implement the migration of other kinds of activities
       if (auto exec = boost::dynamic_pointer_cast<kernel::activity::ExecImpl>(activity))
         exec->migrate(new_host);
index ce57d37..371892e 100644 (file)
@@ -228,7 +228,7 @@ static void sg_platf_new_cluster_hierarchical(const simgrid::kernel::routing::Cl
     set_limiter = std::bind(sg_platf_cluster_create_limiter, cluster, _1, _2, _3);
   }
 
-  simgrid::s4u::NetZone* parent = routing_get_current() ? routing_get_current()->get_iface() : nullptr;
+  simgrid::s4u::NetZone const* parent = routing_get_current() ? routing_get_current()->get_iface() : nullptr;
   simgrid::s4u::NetZone* zone;
   switch (cluster->topology) {
     case simgrid::kernel::routing::ClusterTopology::TORUS: