Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Pointer and reference should be "const" if the corresponding object is not modified...
authorArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 11 Apr 2023 13:26:28 +0000 (15:26 +0200)
committerArnaud Giersch <arnaud.giersch@univ-fcomte.fr>
Tue, 11 Apr 2023 13:26:28 +0000 (15:26 +0200)
src/mc/api/State.cpp
src/mc/api/strategy/WaitStrategy.hpp
src/mc/inspect/mc_unw.cpp
src/mc/inspect/mc_unw.hpp
src/mc/sosp/Snapshot.cpp
src/mc/sosp/Snapshot.hpp

index 58f7d28..bccd340 100644 (file)
@@ -85,7 +85,7 @@ std::size_t State::count_todo() const
 std::size_t State::count_todo_multiples() const
 {
   size_t count = 0;
-  for (auto& [_, actor] : strategy_->actors_to_run_)
+  for (auto const& [_, actor] : strategy_->actors_to_run_)
     if (actor.is_todo())
       count += actor.get_times_not_considered();
 
index e2d466b..39a78c7 100644 (file)
@@ -43,7 +43,7 @@ public:
    *  to decrease the count. */
   void execute_next(aid_t aid, RemoteApp& app) override
   {
-    auto& actor = actors_to_run_.at(aid);
+    auto const& actor = actors_to_run_.at(aid);
     if ((not taking_wait_) and is_transition_wait(actor.get_transition(actor.get_times_considered())->type_)) {
       taken_wait_++;
       taking_wait_ = true;
index d9882f0..d7e0c92 100644 (file)
@@ -216,7 +216,7 @@ unw_addr_space_t UnwindContext::createUnwindAddressSpace()
   return unw_create_addr_space(&accessors, BYTE_ORDER);
 }
 
-void UnwindContext::initialize(simgrid::mc::RemoteProcessMemory& process_memory, unw_context_t* c)
+void UnwindContext::initialize(simgrid::mc::RemoteProcessMemory& process_memory, const unw_context_t* c)
 {
   this->address_space_ = &process_memory;
   this->process_       = &process_memory;
index 7b9babb..6291c1c 100644 (file)
@@ -45,7 +45,7 @@ class UnwindContext {
   unw_context_t unwind_context_              = {};
 
 public:
-  void initialize(simgrid::mc::RemoteProcessMemory& process, unw_context_t* c);
+  void initialize(simgrid::mc::RemoteProcessMemory& process, const unw_context_t* c);
   unw_cursor_t cursor();
 
 private: // Methods and virtual table for libunwind
index 72e2355..eae958d 100644 (file)
@@ -219,7 +219,7 @@ Snapshot::Snapshot(long num_state, PageStore& store, RemoteProcessMemory& memory
   ignore_restore();
 }
 
-void Snapshot::add_region(RegionType type, RemoteProcessMemory& memory, ObjectInformation* object_info,
+void Snapshot::add_region(RegionType type, const RemoteProcessMemory& memory, ObjectInformation* object_info,
                           void* start_addr, std::size_t size)
 {
   if (type == RegionType::Data)
index 04e871c..0b9fb57 100644 (file)
@@ -89,7 +89,7 @@ public:
   std::vector<s_mc_snapshot_ignored_data_t> ignored_data_;
 
 private:
-  void add_region(RegionType type, RemoteProcessMemory& memory, ObjectInformation* object_info, void* start_addr,
+  void add_region(RegionType type, const RemoteProcessMemory& memory, ObjectInformation* object_info, void* start_addr,
                   std::size_t size);
   void snapshot_regions(RemoteProcessMemory& memory);
   void snapshot_stacks(RemoteProcessMemory& memory);