X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6bec471e8974b7d02a0f35ec27067595403f5e1e..02a7d032779c8f37702c9513f1c3fbb988088677:/src/mc/mc_snapshot.cpp diff --git a/src/mc/mc_snapshot.cpp b/src/mc/mc_snapshot.cpp index f72b64ddb1..5a101b92ce 100644 --- a/src/mc/mc_snapshot.cpp +++ b/src/mc/mc_snapshot.cpp @@ -41,10 +41,10 @@ mc_mem_region_t mc_get_snapshot_region( 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 @@ -174,7 +174,7 @@ Snapshot::Snapshot() : 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); @@ -281,19 +281,10 @@ static void test_snapshot(bool sparse_checkpoint) { } 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; @@ -309,11 +300,11 @@ static void test_snapshot(bool sparse_checkpoint) { 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); }