示例#1
0
void mc_region_restore_sparse(mc_process_t process, mc_mem_region_t reg)
{
  xbt_assert(((reg->permanent_address().address()) & (xbt_pagesize-1)) == 0,
    "Not at the beginning of a page");
  xbt_assert(mc_page_count(reg->size()) == reg->page_data().page_count());
  mc_restore_page_snapshot_region(process,
    (void*) reg->permanent_address().address(), reg->page_data());
}
示例#2
0
/** @brief Restore a region from a snapshot
 *
 *  @param reg     Target region
 */
static void MC_region_restore(mc_mem_region_t region)
{
  switch(region->storage_type()) {
  case simgrid::mc::StorageType::NoData:
  default:
    xbt_die("Storage type not supported");
    break;

  case simgrid::mc::StorageType::Flat:
    mc_model_checker->process().write_bytes(region->flat_data().data(),
      region->size(), region->permanent_address());
    break;

  case simgrid::mc::StorageType::Chunked:
    mc_region_restore_sparse(&mc_model_checker->process(), region);
    break;

  case simgrid::mc::StorageType::Privatized:
    for (auto& p : region->privatized_data())
      MC_region_restore(&p);
    break;
  }
}