if (process_index < 0) {
xbt_die("Missing process index");
}
- if (process_index >= (int) region->privatized.regions_count) {
+ if (process_index >= (int) region->privatized_regions_.size()) {
xbt_die("Invalid process index");
}
- mc_mem_region_t priv_region = region->privatized.regions[process_index];
+ mc_mem_region_t priv_region = region->privatized_regions_[process_index].get();
xbt_assert(mc_region_contain(priv_region, addr));
return priv_region;
#else
Snapshot::~Snapshot()
{
for (size_t i = 0; i < this->snapshot_regions_count; i++) {
- MC_region_destroy(this->snapshot_regions[i]);
+ delete this->snapshot_regions[i];
}
xbt_free(this->snapshot_regions);
xbt_free(this->stack_sizes);
}
xbt_test_add("Compare whole region data for %i page(s)", n);
- xbt_test_assert(!MC_snapshot_region_memcmp(source, NULL, source, region, byte_size),
- "Mismatch in MC_snapshot_region_memcmp() for the whole region");
+
xbt_test_assert(MC_snapshot_region_memcmp(source, region0, source, region, byte_size),
"Unexpected match in MC_snapshot_region_memcmp() with previous snapshot");
- xbt_test_add("Compare parts of region data for %i page(s) with current value", n);
- for(int j=0; j!=100; ++j) {
- size_t offset = rand() % byte_size;
- size_t size = rand() % (byte_size - offset);
- xbt_test_assert(!MC_snapshot_region_memcmp((char*) source+offset, NULL, (char*) source+offset, region, size),
- "Mismatch in MC_snapshot_region_memcmp()");
- }
-
xbt_test_add("Compare parts of region data for %i page(s) with itself", n);
for(int j=0; j!=100; ++j) {
size_t offset = rand() % byte_size;
MC_REGION_TYPE_UNKNOWN, source, source, byte_size);
xbt_test_assert(MC_region_read_pointer(region2, source) == mc_model_checker,
"Mismtach in MC_region_read_pointer()");
- MC_region_destroy(region2);
+ delete region2;
}
- MC_region_destroy(region);
- MC_region_destroy(region0);
+ delete region;
+ delete region0;
munmap(destination, byte_size);
munmap(source, byte_size);
}