Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[mc] Add std:: namespace for some types
authorGabriel Corona <gabriel.corona@loria.fr>
Thu, 15 Oct 2015 13:35:39 +0000 (15:35 +0200)
committerGabriel Corona <gabriel.corona@loria.fr>
Thu, 15 Oct 2015 14:02:07 +0000 (16:02 +0200)
src/mc/PageStore.hpp
src/mc/RegionSnapshot.hpp
src/mc/mc_checkpoint.cpp
src/mc/mc_diff.cpp
src/mc/mc_protocol.cpp
src/mc/mc_snapshot.h

index 4e2e53e..36c90d0 100644 (file)
@@ -131,10 +131,10 @@ public: // Methods
    * changed since the previous cnapshot/restoration and we can avoid
    * hashing the page, comparing byte-per-byte to candidates.
    * */
    * changed since the previous cnapshot/restoration and we can avoid
    * hashing the page, comparing byte-per-byte to candidates.
    * */
-  void ref_page(std::size_t pageno);
+  void ref_page(size_t pageno);
 
   /** @brief Store a page in the page store */
 
   /** @brief Store a page in the page store */
-  size_t store_page(void* page);
+  std::size_t store_page(void* page);
 
   /** @brief Get a page from its page number
    *
 
   /** @brief Get a page from its page number
    *
@@ -184,7 +184,7 @@ std::size_t PageStore::get_ref(std::size_t pageno)
 }
 
 inline __attribute__((always_inline))
 }
 
 inline __attribute__((always_inline))
-size_t PageStore::size() {
+std::size_t PageStore::size() {
   return this->top_index_ - this->free_pages_.size();
 }
 
   return this->top_index_ - this->free_pages_.size();
 }
 
index 11ba6f8..9a9b219 100644 (file)
@@ -84,7 +84,7 @@ private:
   void *start_addr_;
 
   /** @brief Size of the data region in bytes */
   void *start_addr_;
 
   /** @brief Size of the data region in bytes */
-  size_t size_;
+  std::size_t size_;
 
   /** @brief Permanent virtual address of the region
    *
 
   /** @brief Permanent virtual address of the region
    *
@@ -224,14 +224,14 @@ public:
 };
 
 RegionSnapshot privatized_region(
 };
 
 RegionSnapshot privatized_region(
-  RegionType type, void *start_addr, void* data_addr, size_t size);
+  RegionType type, void *start_addr, void* data_addr, std::size_t size);
 RegionSnapshot dense_region(
 RegionSnapshot dense_region(
-  RegionType type, void *start_addr, void* data_addr, size_t size);
+  RegionType type, void *start_addr, void* data_addr, std::size_t size);
 simgrid::mc::RegionSnapshot sparse_region(
 simgrid::mc::RegionSnapshot sparse_region(
-  RegionType type, void *start_addr, void* data_addr, size_t size,
+  RegionType type, void *start_addr, void* data_addr, std::size_t size,
   RegionSnapshot const* ref_region);
 simgrid::mc::RegionSnapshot region(
   RegionSnapshot const* ref_region);
 simgrid::mc::RegionSnapshot region(
-  RegionType type, void *start_addr, void* data_addr, size_t size,
+  RegionType type, void *start_addr, void* data_addr, std::size_t size,
   RegionSnapshot const* ref_region);
 
 }
   RegionSnapshot const* ref_region);
 
 }
index 746d20b..4360d06 100644 (file)
@@ -85,8 +85,8 @@ namespace mc {
 
 #ifdef HAVE_SMPI
 simgrid::mc::RegionSnapshot privatized_region(
 
 #ifdef HAVE_SMPI
 simgrid::mc::RegionSnapshot privatized_region(
-    RegionType region_type, void *start_addr, void* permanent_addr, size_t size,
-    const simgrid::mc::RegionSnapshot* ref_region
+    RegionType region_type, void *start_addr, void* permanent_addr,
+    std::size_t size, const simgrid::mc::RegionSnapshot* ref_region
     )
 {
   size_t process_count = MC_smpi_process_count();
     )
 {
   size_t process_count = MC_smpi_process_count();
@@ -126,7 +126,8 @@ extern "C" {
 static void MC_snapshot_add_region(int index, mc_snapshot_t snapshot,
                                   simgrid::mc::RegionType type,
                                   simgrid::mc::ObjectInformation* object_info,
 static void MC_snapshot_add_region(int index, mc_snapshot_t snapshot,
                                   simgrid::mc::RegionType type,
                                   simgrid::mc::ObjectInformation* object_info,
-                                  void *start_addr, void* permanent_addr, size_t size)
+                                  void *start_addr, void* permanent_addr,
+                                  std::size_t size)
 {
   if (type == simgrid::mc::RegionType::Data)
     xbt_assert(object_info, "Missing object info for object.");
 {
   if (type == simgrid::mc::RegionType::Data)
     xbt_assert(object_info, "Missing object info for object.");
@@ -196,7 +197,8 @@ static void MC_get_memory_regions(simgrid::mc::Process* process, mc_snapshot_t s
  *  `dl_iterate_phdr` would be more robust but would not work in cross-process.
  * */
 void MC_find_object_address(
  *  `dl_iterate_phdr` would be more robust but would not work in cross-process.
  * */
 void MC_find_object_address(
-  std::vector<simgrid::mc::VmMap> const& maps, simgrid::mc::ObjectInformation* result)
+  std::vector<simgrid::mc::VmMap> const& maps,
+  simgrid::mc::ObjectInformation* result)
 {
   char* file_name = xbt_strdup(result->file_name.c_str());
   const char *name = basename(file_name);
 {
   char* file_name = xbt_strdup(result->file_name.c_str());
   const char *name = basename(file_name);
@@ -261,7 +263,8 @@ void MC_find_object_address(
  *  \param ip    Instruction pointer
  *  \return      true if the variable is valid
  * */
  *  \param ip    Instruction pointer
  *  \return      true if the variable is valid
  * */
-static bool mc_valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* scope,
+static bool mc_valid_variable(simgrid::mc::Variable* var,
+                              simgrid::mc::Frame* scope,
                               const void *ip)
 {
   // The variable is not yet valid:
                               const void *ip)
 {
   // The variable is not yet valid:
@@ -272,7 +275,8 @@ static bool mc_valid_variable(simgrid::mc::Variable* var, simgrid::mc::Frame* sc
 }
 
 static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame,
 }
 
 static void mc_fill_local_variables_values(mc_stack_frame_t stack_frame,
-                                           simgrid::mc::Frame* scope, int process_index,
+                                           simgrid::mc::Frame* scope,
+                                           int process_index,
                                            std::vector<s_local_variable>& result)
 {
   simgrid::mc::Process* process = &mc_model_checker->process();
                                            std::vector<s_local_variable>& result)
 {
   simgrid::mc::Process* process = &mc_model_checker->process();
index 50e58cd..7b7ecb7 100644 (file)
@@ -34,15 +34,15 @@ typedef char *type_name;
 
 struct XBT_PRIVATE s_mc_diff {
   s_xbt_mheap_t std_heap_copy;
 
 struct XBT_PRIVATE s_mc_diff {
   s_xbt_mheap_t std_heap_copy;
-  size_t heaplimit;
+  std::size_t heaplimit;
   // Number of blocks in the heaps:
   // Number of blocks in the heaps:
-  size_t heapsize1, heapsize2;
+  std::size_t heapsize1, heapsize2;
   std::vector<s_mc_heap_ignore_region_t>* to_ignore1;
   std::vector<s_mc_heap_ignore_region_t>* to_ignore2;
   s_heap_area_t *equals_to1, *equals_to2;
   simgrid::mc::Type **types1;
   simgrid::mc::Type **types2;
   std::vector<s_mc_heap_ignore_region_t>* to_ignore1;
   std::vector<s_mc_heap_ignore_region_t>* to_ignore2;
   s_heap_area_t *equals_to1, *equals_to2;
   simgrid::mc::Type **types1;
   simgrid::mc::Type **types2;
-  size_t available;
+  std::size_t available;
 };
 
 #define equals_to1_(i,j) equals_to1[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)]
 };
 
 #define equals_to1_(i,j) equals_to1[ MAX_FRAGMENT_PER_BLOCK*(i) + (j)]
index 09b3227..325b433 100644 (file)
@@ -19,7 +19,7 @@ extern "C" {
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_protocol, mc, "Generic MC protocol logic");
 
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_protocol, mc, "Generic MC protocol logic");
 
-int MC_protocol_send(int socket, const void* message, size_t size)
+int MC_protocol_send(int socket, const void* message, std::size_t size)
 {
   XBT_DEBUG("Protocol [%s] send %s",
     MC_mode_name(mc_mode),
 {
   XBT_DEBUG("Protocol [%s] send %s",
     MC_mode_name(mc_mode),
index 6977237..239d26d 100644 (file)
@@ -149,14 +149,14 @@ public:
     ReadMode mode = Normal) const override;
 public: // To be private
   int num_state;
     ReadMode mode = Normal) const override;
 public: // To be private
   int num_state;
-  size_t heap_bytes_used;
+  std::size_t heap_bytes_used;
   std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
   std::set<pid_t> enabled_processes;
   int privatization_index;
   std::vector<std::unique_ptr<s_mc_mem_region_t>> snapshot_regions;
   std::set<pid_t> enabled_processes;
   int privatization_index;
-  std::vector<size_t> stack_sizes;
+  std::vector<std::size_t> stack_sizes;
   std::vector<s_mc_snapshot_stack_t> stacks;
   std::vector<s_mc_heap_ignore_region_t> to_ignore;
   std::vector<s_mc_snapshot_stack_t> stacks;
   std::vector<s_mc_heap_ignore_region_t> to_ignore;
-  uint64_t hash;
+  std::uint64_t hash;
   std::vector<s_mc_snapshot_ignored_data> ignored_data;
   std::vector<s_fd_infos_t> current_fds;
 };
   std::vector<s_mc_snapshot_ignored_data> ignored_data;
   std::vector<s_fd_infos_t> current_fds;
 };
@@ -185,14 +185,14 @@ XBT_PRIVATE void mc_restore_page_snapshot_region(
   void* start_addr, simgrid::mc::ChunkedData const& pagenos);
 
 const void* MC_region_read_fragmented(
   void* start_addr, simgrid::mc::ChunkedData const& pagenos);
 
 const void* MC_region_read_fragmented(
-  mc_mem_region_t region, void* target, const void* addr, size_t size);
+  mc_mem_region_t region, void* target, const void* addr, std::size_t size);
 
 int MC_snapshot_region_memcmp(
   const void* addr1, mc_mem_region_t region1,
 
 int MC_snapshot_region_memcmp(
   const void* addr1, mc_mem_region_t region1,
-  const void* addr2, mc_mem_region_t region2, size_t size);
+  const void* addr2, mc_mem_region_t region2, std::size_t size);
 XBT_PRIVATE int MC_snapshot_memcmp(
   const void* addr1, mc_snapshot_t snapshot1,
 XBT_PRIVATE int MC_snapshot_memcmp(
   const void* addr1, mc_snapshot_t snapshot1,
-  const void* addr2, mc_snapshot_t snapshot2, int process_index, size_t size);
+  const void* addr2, mc_snapshot_t snapshot2, int process_index, std::size_t size);
 
 static inline __attribute__ ((always_inline))
 const void* mc_snapshot_get_heap_end(mc_snapshot_t snapshot)
 
 static inline __attribute__ ((always_inline))
 const void* mc_snapshot_get_heap_end(mc_snapshot_t snapshot)
@@ -211,11 +211,13 @@ const void* mc_snapshot_get_heap_end(mc_snapshot_t snapshot)
  *  @return Pointer where the data is located (target buffer of original location)
  */
 static inline __attribute__((always_inline))
  *  @return Pointer where the data is located (target buffer of original location)
  */
 static inline __attribute__((always_inline))
-const void* MC_region_read(mc_mem_region_t region, void* target, const void* addr, size_t size)
+const void* MC_region_read(
+  mc_mem_region_t region, void* target, const void* addr, std::size_t size)
 {
   xbt_assert(region);
 
 {
   xbt_assert(region);
 
-  uintptr_t offset = (uintptr_t) addr - (uintptr_t) region->start().address();
+  std::uintptr_t offset =
+    (std::uintptr_t) addr - (std::uintptr_t) region->start().address();
 
   xbt_assert(region->contain(simgrid::mc::remote(addr)),
     "Trying to read out of the region boundary.");
 
   xbt_assert(region->contain(simgrid::mc::remote(addr)),
     "Trying to read out of the region boundary.");