/**************** Class BOOST_tests *************************/
using simgrid::mc::Region;
class snap_test_helper {
+ static simgrid::mc::PageStore page_store_;
+
public:
static void init_memory(void* mem, size_t size);
static void Init();
// static member variables init.
std::unique_ptr<simgrid::mc::RemoteProcess> snap_test_helper::process = nullptr;
+simgrid::mc::PageStore snap_test_helper::page_store_(500);
void snap_test_helper::init_memory(void* mem, size_t size)
{
// Init memory and take snapshots:
init_memory(source, byte_size);
- auto* region0 = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size);
+ auto* region0 = new simgrid::mc::Region(page_store_, simgrid::mc::RegionType::Data, source, byte_size);
for (int i = 0; i < n; i += 2) {
init_memory((char*)source + i * xbt_pagesize, xbt_pagesize);
}
- auto* region = new simgrid::mc::Region(simgrid::mc::RegionType::Data, source, byte_size);
+ auto* region = new simgrid::mc::Region(page_store_, simgrid::mc::RegionType::Data, source, byte_size);
void* destination = mmap(nullptr, byte_size, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANONYMOUS, -1, 0);
INFO("Could not allocate destination memory");
{
prologue_return ret = prologue(1);
memcpy(ret.src, &mc_model_checker, sizeof(void*));
- const simgrid::mc::Region region2(simgrid::mc::RegionType::Data, ret.src, ret.size);
+ const simgrid::mc::Region region2(page_store_, simgrid::mc::RegionType::Data, ret.src, ret.size);
INFO("Mismtach in MC_region_read_pointer()");
REQUIRE(MC_region_read_pointer(®ion2, ret.src) == mc_model_checker);