-static void MC_snapshot_stack_free(mc_snapshot_stack_t s)
-{
- if (s) {
- xbt_dynar_free(&(s->local_variables));
- xbt_dynar_free(&(s->stack_frames));
- mc_unw_destroy_context(s->context);
- xbt_free(s->context);
- xbt_free(s);
- }
-}
-
-static void MC_snapshot_stack_free_voidp(void *s)
-{
- mc_snapshot_stack_t stack = (mc_snapshot_stack_t) * (void **) s;
- MC_snapshot_stack_free(stack);
-}
-
-static void local_variable_free(local_variable_t v)
-{
- xbt_free(v->name);
- xbt_free(v);
-}
-
-static void local_variable_free_voidp(void *v)
-{
- local_variable_free((local_variable_t) * (void **) v);
-}
-
-}
-
-namespace simgrid {
-namespace mc {
-
-RegionSnapshot::~RegionSnapshot() {}
-
-simgrid::mc::RegionSnapshot dense_region(
- mc_region_type_t region_type,
- void *start_addr, void* permanent_addr, size_t size)
-{
- std::vector<char> data(size);
- mc_model_checker->process().read_bytes(data.data(), size,
- remote(permanent_addr),
- simgrid::mc::ProcessIndexDisabled);
-
- simgrid::mc::RegionSnapshot region(
- region_type, start_addr, permanent_addr, size);
- region.flat_data(std::move(data));
-
- XBT_DEBUG("New region : type : %d, data : %p (real addr %p), size : %zu",
- region_type, region.flat_data().data(), permanent_addr, size);
- return std::move(region);
-}
-
-/** @brief Take a snapshot of a given region
- *
- * @param type
- * @param start_addr Address of the region in the simulated process
- * @param permanent_addr Permanent address of this data (for privatized variables, this is the virtual address of the privatized mapping)
- * @param size Size of the data*
- */
-static simgrid::mc::RegionSnapshot region(
- mc_region_type_t type, void *start_addr, void* permanent_addr, size_t size)