Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Use std::equal_range in get_search_range()
[simgrid.git] / src / mc / mc_safety.h
index 931584b..0bbe379 100644 (file)
@@ -9,6 +9,9 @@
 
 #include <stdint.h>
 
+#include <vector>
+#include <memory>
+
 #include <simgrid_config.h>
 
 #include <xbt/base.h>
@@ -28,21 +31,20 @@ enum class ReductionMode {
 
 extern XBT_PRIVATE simgrid::mc::ReductionMode reduction_mode;
 
-int modelcheck_safety(void);
-
 struct XBT_PRIVATE VisitedState {
-  mc_snapshot_t system_state;
-  size_t heap_bytes_used;
-  int nb_processes;
-  int num;
-  int other_num; // dot_output for
+  simgrid::mc::Snapshot* system_state = nullptr;
+  size_t heap_bytes_used = 0;
+  int nb_processes = 0;
+  int num = 0;
+  int other_num = 0; // dot_output for
 
   VisitedState();
   ~VisitedState();
 };
 
-extern XBT_PRIVATE xbt_dynar_t visited_states;
-XBT_PRIVATE simgrid::mc::VisitedState* is_visited_state(mc_state_t graph_state);
+extern XBT_PRIVATE std::vector<std::unique_ptr<simgrid::mc::VisitedState>> visited_states;
+XBT_PRIVATE std::unique_ptr<simgrid::mc::VisitedState> is_visited_state(mc_state_t graph_state);
+XBT_PRIVATE int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2);
 
 }
 }