-static mc_mem_region_t mc_region_new_dense(
- mc_region_type_t region_type,
- void *start_addr, void* permanent_addr, size_t size)
-{
- mc_mem_region_t region = new simgrid::mc::RegionSnapshot();
- region->region_type = region_type;
- region->storage_type = MC_REGION_STORAGE_TYPE_FLAT;
- region->start_addr = start_addr;
- region->permanent_addr = permanent_addr;
- region->size = size;
- region->flat_data_.resize(size);
- mc_model_checker->process().read_bytes(region->flat_data_.data(), size,
- remote(permanent_addr),
- simgrid::mc::ProcessIndexDisabled);
- XBT_DEBUG("New region : type : %d, data : %p (real addr %p), size : %zu",
- region_type, region->flat_data_.data(), permanent_addr, size);
- return 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 mc_mem_region_t MC_region_new(
- mc_region_type_t type, void *start_addr, void* permanent_addr, size_t size)
-{
- if (_sg_mc_sparse_checkpoint) {
- return mc_region_new_sparse(type, start_addr, permanent_addr, size);
- } else {
- return mc_region_new_dense(type, start_addr, permanent_addr, size);
- }
-}
-