Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mc: useless cleanups
authorMartin Quinson <martin.quinson@ens-rennes.fr>
Wed, 15 May 2019 23:46:24 +0000 (01:46 +0200)
committerMartin Quinson <martin.quinson@ens-rennes.fr>
Thu, 16 May 2019 00:44:31 +0000 (02:44 +0200)
src/mc/sosp/RegionSnapshot.cpp

index c638c81..4a506bf 100644 (file)
@@ -22,20 +22,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_RegionSnaphot, mc, "Logging specific to regio
 namespace simgrid {
 namespace mc {
 
-static inline const char* to_cstr(RegionType region)
-{
-  switch (region) {
-    case RegionType::Unknown:
-      return "unknown";
-    case RegionType::Heap:
-      return "Heap";
-    case RegionType::Data:
-      return "Data";
-    default:
-      return "?";
-  }
-}
-
 RegionSnapshot dense_region(RegionType region_type, void* start_addr, void* permanent_addr, size_t size)
 {
   simgrid::mc::Buffer data = Buffer::malloc(size);
@@ -45,7 +31,8 @@ RegionSnapshot dense_region(RegionType region_type, void* start_addr, void* perm
   simgrid::mc::RegionSnapshot region(region_type, start_addr, permanent_addr, size);
   region.flat_data(std::move(data));
 
-  XBT_DEBUG("New region : type : %s, data : %p (real addr %p), size : %zu", to_cstr(region_type),
+  XBT_DEBUG("New region : type : %s, data : %p (real addr %p), size : %zu",
+            (region_type == RegionType::Heap ? "Heap" : (region_type == RegionType::Data ? "Data" : "?")),
             region.flat_data().get(), permanent_addr, size);
   return region;
 }
@@ -71,8 +58,9 @@ RegionSnapshot sparse_region(RegionType region_type, void* start_addr, void* per
   simgrid::mc::RemoteClient* process = &mc_model_checker->process();
   assert(process != nullptr);
 
-  xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
-  xbt_assert((((uintptr_t)permanent_addr) & (xbt_pagesize - 1)) == 0, "Not at the beginning of a page");
+  xbt_assert((((uintptr_t)start_addr) & (xbt_pagesize - 1)) == 0, "Start address not at the beginning of a page");
+  xbt_assert((((uintptr_t)permanent_addr) & (xbt_pagesize - 1)) == 0,
+             "Permanent address not at the beginning of a page");
   size_t page_count = simgrid::mc::mmu::chunkCount(size);
 
   simgrid::mc::ChunkedData page_data(mc_model_checker->page_store(), *process, RemotePtr<void>(permanent_addr),