- PerPageCopy(PageStore& store, AddressSpace& as,
- remote_ptr<void> addr, std::size_t page_count);
-};
-
-/** @brief Copy/snapshot of a given memory region
- *
- * Different types of region snapshot storage types exist:
- * <ul>
- * <li>flat/dense snapshots are a simple copy of the region;</li>
- * <li>sparse/per-page snapshots are snaapshots which shared
- * identical pages.</li>
- * <li>privatized (SMPI global variable privatisation).
- * </ul>
- *
- * This is handled with a variant based approch:
- *
- * * `storage_type` identified the type of storage;
- * * an anonymous enum is used to distinguish the relevant types for
- * each type.
- */
-class RegionSnapshot {
-public:
- mc_region_type_t region_type;
- mc_region_storage_type_t storage_type;
- mc_object_info_t object_info;
-
- /** @brief Virtual address of the region in the simulated process */
- void *start_addr;
-
- /** @brief Size of the data region in bytes */
- size_t size;
-
- /** @brief Permanent virtual address of the region
- *
- * This is usually the same address as the simuilated process address.
- * However, when using SMPI privatization of global variables,
- * each SMPI process has its own set of global variables stored
- * at a different virtual address. The scheduler maps those region
- * on the region of the global variables.
- *
- * */
- void *permanent_addr;
-
- std::vector<char> flat_data_;
- PerPageCopy page_numbers_;
- std::vector<std::unique_ptr<RegionSnapshot>> privatized_regions_;
-public:
- RegionSnapshot() :
- region_type(MC_REGION_TYPE_UNKNOWN),
- storage_type(MC_REGION_STORAGE_TYPE_NONE),
- object_info(nullptr),
- start_addr(nullptr),
- size(0),
- permanent_addr(nullptr)
- {}
- ~RegionSnapshot();
- RegionSnapshot(RegionSnapshot const&) = delete;
- RegionSnapshot& operator=(RegionSnapshot const&) = delete;
-};
-
-}
-}
-
-typedef class simgrid::mc::RegionSnapshot s_mc_mem_region_t, *mc_mem_region_t;
-
-MC_SHOULD_BE_INTERNAL mc_mem_region_t mc_region_new_sparse(
- mc_region_type_t type, void *start_addr, void* data_addr, size_t size);
-XBT_INTERNAL void mc_region_restore_sparse(mc_process_t process, mc_mem_region_t reg);
-
-static inline __attribute__ ((always_inline))
-bool mc_region_contain(mc_mem_region_t region, const void* p)