-static int snapshot_compare(simgrid::mc::VisitedState* state1, simgrid::mc::VisitedState* state2)
-{
- simgrid::mc::Snapshot* s1 = state1->system_state.get();
- simgrid::mc::Snapshot* s2 = state2->system_state.get();
- int num1 = state1->num;
- int num2 = state2->num;
- return snapshot_compare(num1, s1, num2, s2);
-}
-
-/**
- * \brief Save the current state
- * \return Snapshot of the current state.
- */
-VisitedState::VisitedState(unsigned long state_number)
-{
- simgrid::mc::Process* process = &(mc_model_checker->process());
- this->heap_bytes_used = mmalloc_get_bytes_used_remote(
- process->get_heap()->heaplimit,
- process->get_malloc_info());
-
- this->actors_count = mc_model_checker->process().actors().size();
-
- this->system_state = simgrid::mc::take_snapshot(state_number);
- this->num = state_number;
- this->original_num = -1;
-}
-
-VisitedState::~VisitedState()
-{
+/** @brief Save the current state */
+VisitedState::VisitedState(unsigned long state_number) : num(state_number)
+{
+ this->heap_bytes_used = api::get().get_remote_heap_bytes();
+ this->actors_count = api::get().get_actors_size();
+ this->system_state = std::make_shared<simgrid::mc::Snapshot>(state_number);