From 84c28d7e6db056de0252dd406bbe8dad68cda16a Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Thu, 30 May 2019 16:43:01 +0200 Subject: [PATCH] inline a function --- src/mc/sosp/ChunkedData.hpp | 1 + src/mc/sosp/RegionSnapshot.cpp | 13 ------------- src/mc/sosp/RegionSnapshot.hpp | 21 +-------------------- src/mc/sosp/mc_snapshot.cpp | 2 +- 4 files changed, 3 insertions(+), 34 deletions(-) diff --git a/src/mc/sosp/ChunkedData.hpp b/src/mc/sosp/ChunkedData.hpp index 33f71a526c..4c143ea280 100644 --- a/src/mc/sosp/ChunkedData.hpp +++ b/src/mc/sosp/ChunkedData.hpp @@ -9,6 +9,7 @@ #include #include "src/mc/mc_forward.hpp" +#include "src/mc/remote/RemotePtr.hpp" #include "src/mc/sosp/PageStore.hpp" namespace simgrid { diff --git a/src/mc/sosp/RegionSnapshot.cpp b/src/mc/sosp/RegionSnapshot.cpp index 4088d43a3c..c9388e71bc 100644 --- a/src/mc/sosp/RegionSnapshot.cpp +++ b/src/mc/sosp/RegionSnapshot.cpp @@ -22,19 +22,6 @@ XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_RegionSnaphot, mc, "Logging specific to regio namespace simgrid { namespace mc { -/** @brief Take a snapshot of a given region - * - * @param type - * @param start_addr Address of the region in the simulated process - * @param permanent_addr Permanent address of this data (for privatized variables, this is the virtual address of the - * privatized mapping) - * @param size Size of the data* - */ -RegionSnapshot* region(RegionType type, void* start_addr, void* permanent_addr, size_t size) -{ - return new RegionSnapshot(type, start_addr, permanent_addr, size); -} - RegionSnapshot::RegionSnapshot(RegionType region_type, void* start_addr, void* permanent_addr, size_t size) : region_type_(region_type), start_addr_(start_addr), size_(size), permanent_addr_(permanent_addr) { diff --git a/src/mc/sosp/RegionSnapshot.hpp b/src/mc/sosp/RegionSnapshot.hpp index 8ceb446040..b194a8078b 100644 --- a/src/mc/sosp/RegionSnapshot.hpp +++ b/src/mc/sosp/RegionSnapshot.hpp @@ -17,24 +17,7 @@ namespace mc { enum class RegionType { Unknown = 0, Heap = 1, Data = 2 }; -/** A copy/snapshot of a given memory region - * - * Different types of region snapshot storage types exist: - * - * * flat/dense snapshots are a simple copy of the region; - * - * * sparse/per-page snapshots are snaapshots which shared - * identical pages. - * - * * privatized (SMPI global variable privatization). - * - * This is handled with a variant based approach: - * - * * `storage_type` identified the type of storage; - * - * * an anonymous enum is used to distinguish the relevant types for - * each type. - */ +/** A copy/snapshot of a given memory region, where identical pages are stored only once */ class RegionSnapshot { public: static const RegionType UnknownRegion = RegionType::Unknown; @@ -127,8 +110,6 @@ public: void restore(); }; -RegionSnapshot* region(RegionType type, void* start_addr, void* data_addr, std::size_t size); - } // namespace mc } // namespace simgrid diff --git a/src/mc/sosp/mc_snapshot.cpp b/src/mc/sosp/mc_snapshot.cpp index fbe1a4297d..50275e21d8 100644 --- a/src/mc/sosp/mc_snapshot.cpp +++ b/src/mc/sosp/mc_snapshot.cpp @@ -307,7 +307,7 @@ void Snapshot::add_region(RegionType type, ObjectInformation* object_info, void* else if (type == simgrid::mc::RegionType::Heap) xbt_assert(not object_info, "Unexpected object info for heap region."); - simgrid::mc::RegionSnapshot* region = simgrid::mc::region(type, start_addr, permanent_addr, size); + simgrid::mc::RegionSnapshot* region = new RegionSnapshot(type, start_addr, permanent_addr, size); region->object_info(object_info); snapshot_regions_.push_back(std::unique_ptr(std::move(region))); } -- 2.20.1