Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Make s_mc_global_t::stacks a std::vector
[simgrid.git] / src / mc / mc_hash.cpp
index 834308e..c830253 100644 (file)
@@ -4,14 +4,15 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <cinttypes>
+
 #include <stdint.h>
 #include <stdbool.h>
 
 #include "mc_private.h"
 #include "mc/datatypes.h"
 #include <mc/mc.h>
-
-extern "C" {
+#include "mc_hash.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_hash, mc, "Logging specific to mc_hash");
 
@@ -26,6 +27,7 @@ typedef uint64_t mc_hash_t;
 
 // ***** Hash state
 
+#if 0
 typedef struct s_mc_hashing_state {
   // Set of pointers/addresses already processed (avoid loops):
   mc_address_set_t handled_addresses;
@@ -70,7 +72,6 @@ static void mc_hash_binary(mc_hash_t * hash, const void *s, size_t len)
   }
 }
 
-#if 0
 /** \brief Compute a hash for a given value of a given type
  *
  *  We try to be very conservative (do not hash too ambiguous things).
@@ -82,7 +83,7 @@ static void mc_hash_value(mc_hash_t * hash, mc_hashing_state * state,
                           mc_object_info_t info, const void *address,
                           dw_type_t type)
 {
-  mc_process_t process = &mc_model_checker->process;
+  mc_process_t process = &mc_model_checker->process();
 top:
 
   switch (type->type) {
@@ -320,24 +321,25 @@ static void mc_hash_stacks(mc_hash_t * hash, mc_hashing_state * state,
 }
 #endif
 
-uint64_t mc_hash_processes_state(int num_state, xbt_dynar_t stacks)
+uint64_t mc_hash_processes_state(int num_state, std::vector<s_mc_snapshot_stack_t> const& stacks)
 {
   XBT_DEBUG("START hash %i", num_state);
 
+#if 0
   mc_hashing_state state;
   mc_hash_state_init(&state);
+#endif
 
   mc_hash_t hash = MC_HASH_INIT;
 
   MC_HASH(hash, xbt_swag_size(simix_global->process_list));     // process count
+#if 0
   // mc_hash_object_globals(&hash, &state, binary_info);
   // mc_hash_object_globals(&hash, &state, libsimgrid_info);
   // mc_hash_stacks(&hash, &state, stacks);
-
   mc_hash_state_destroy(&state);
+#endif
 
   XBT_DEBUG("END hash %i", num_state);
   return hash;
 }
-
-}