Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'master' of github.com:mquinson/simgrid
[simgrid.git] / src / mc / RegionSnapshot.cpp
index 6d50ef1..7e96951 100644 (file)
@@ -4,11 +4,15 @@
 /* This program is free software; you can redistribute it and/or modify it
  * under the terms of the license (GNU LGPL) which comes with this package. */
 
+#include <cstdlib>
+
 #include <sys/mman.h>
 
 #include "mc/mc.h"
-#include "mc_snapshot.h"
-#include "RegionSnapshot.hpp"
+#include "src/mc/mc_snapshot.h"
+
+#include "src/mc/ChunkedData.hpp"
+#include "src/mc/RegionSnapshot.hpp"
 
 extern "C" {
 
@@ -39,7 +43,7 @@ void data_deleter::operator()(void* p) const
 {
   switch(type_) {
   case Free:
-    free(p);
+    std::free(p);
     break;
   case Munmap:
     munmap(p, size_);
@@ -53,7 +57,7 @@ RegionSnapshot dense_region(
 {
   simgrid::mc::RegionSnapshot::flat_data_ptr data;
   if (!_sg_mc_ksm)
-    data = simgrid::mc::RegionSnapshot::flat_data_ptr((char*) malloc(size));
+    data = simgrid::mc::RegionSnapshot::flat_data_ptr((char*) std::malloc(size));
   else {
     char* ptr = (char*) mmap(nullptr, size, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS|MAP_POPULATE, -1, 0);
     if (ptr == MAP_FAILED)
@@ -102,6 +106,7 @@ RegionSnapshot sparse_region(RegionType region_type,
   RegionSnapshot const* ref_region)
 {
   simgrid::mc::Process* process = &mc_model_checker->process();
+  assert(process != nullptr);
 
   bool use_soft_dirty = _sg_mc_sparse_checkpoint && _sg_mc_soft_dirty
     && ref_region != nullptr
@@ -122,7 +127,7 @@ RegionSnapshot sparse_region(RegionType region_type,
     ref_page_numbers = ref_region->page_data().pagenos();
   }
 
-  simgrid::mc::PerPageCopy page_data(
+  simgrid::mc::ChunkedData page_data(
     mc_model_checker->page_store(), *process, permanent_addr, page_count,
     ref_page_numbers,
     use_soft_dirty ? pagemap.data() : nullptr);