xbt_assert((((uintptr_t)permanent_addr) & (xbt_pagesize - 1)) == 0,
"Permanent address not at the beginning of a page");
- page_numbers_ =
+ chunks_ =
ChunkedData(mc_model_checker->page_store(), *process, RemotePtr<void>(permanent_addr), mmu::chunk_count(size));
}
void RegionSnapshot::restore()
{
xbt_assert(((permanent_address().address()) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
- xbt_assert(simgrid::mc::mmu::chunk_count(size()) == page_data().page_count());
+ xbt_assert(simgrid::mc::mmu::chunk_count(size()) == chunks().page_count());
- for (size_t i = 0; i != page_data().page_count(); ++i) {
+ for (size_t i = 0; i != chunks().page_count(); ++i) {
void* target_page = (void*)simgrid::mc::mmu::join(i, (std::uintptr_t)(void*)permanent_address().address());
- const void* source_page = page_data().page(i);
+ const void* source_page = chunks().page(i);
mc_model_checker->process().write_bytes(source_page, xbt_pagesize, remote(target_page));
}
}
* */
void* permanent_addr_ = nullptr;
- ChunkedData page_numbers_;
+ ChunkedData chunks_;
public:
RegionSnapshot(RegionType type, void* start_addr, void* permanent_addr, size_t size);
, start_addr_(that.start_addr_)
, size_(that.size_)
, permanent_addr_(that.permanent_addr_)
- , page_numbers_(std::move(that.page_numbers_))
+ , chunks_(std::move(that.chunks_))
{
that.clear();
}
start_addr_ = that.start_addr_;
size_ = that.size_;
permanent_addr_ = that.permanent_addr_;
- page_numbers_ = std::move(that.page_numbers_);
+ chunks_ = std::move(that.chunks_);
that.clear();
return *this;
}
void clear()
{
region_type_ = UnknownRegion;
- page_numbers_.clear();
+ chunks_.clear();
object_info_ = nullptr;
start_addr_ = nullptr;
size_ = 0;
permanent_addr_ = nullptr;
}
- void clear_data()
- {
- page_numbers_.clear();
- }
-
- ChunkedData const& page_data() const { return page_numbers_; }
+ ChunkedData const& chunks() const { return chunks_; }
simgrid::mc::ObjectInformation* object_info() const { return object_info_; }
void object_info(simgrid::mc::ObjectInformation* info) { object_info_ = info; }
auto split = simgrid::mc::mmu::split(addr - region->start().address());
auto pageno = split.first;
auto offset = split.second;
- const void* snapshot_page = region->page_data().page(pageno);
+ const void* snapshot_page = region->chunks().page(pageno);
return (char*)snapshot_page + offset;
}