Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
mv simgrid_config.h simgrid/config
[simgrid.git] / src / mc / PageStore.cpp
index 29d624c..d792f1c 100644 (file)
@@ -1,11 +1,11 @@
-/* Copyright (c) 2015. The SimGrid Team.
+/* Copyright (c) 2015-2018. The SimGrid Team.
  * All rights reserved.                                                     */
 
 /* 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 <cstring> // memcpy, memcmp
 #include <unistd.h>
-#include <string.h> // memcpy, memcmp
 
 #include <sys/mman.h>
 #ifdef __FreeBSD__
@@ -20,7 +20,7 @@
 
 #include "src/mc/PageStore.hpp"
 
-#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_mmu.hpp"
 
 XBT_LOG_NEW_DEFAULT_SUBCATEGORY(mc_page_snapshot, mc, "Logging specific to mc_page_snapshot");
 
@@ -155,14 +155,14 @@ std::size_t PageStore::store_page(void* page)
   xbt_assert(top_index_ <= this->capacity_, "top_index is not consistent");
 
   // First, we check if a page with the same content is already in the page store:
-  //  1. compute the hash of the page;
-  //  2. find pages with the same hash using `hash_index_`;
-  //  3. find a page with the same content.
+  //  1. compute the hash of the page
+  //  2. find pages with the same hash using `hash_index_`
+  //  3. find a page with the same content
   hash_type hash = mc_hash_page(page);
 
   // Try to find a duplicate in set of pages with the same hash:
   page_set_type& page_set = this->hash_index_[hash];
-  for (size_t pageno : page_set) {
+  for (size_t const& pageno : page_set) {
     const void* snapshot_page = this->get_page(pageno);
     if (memcmp(page, snapshot_page, xbt_pagesize) == 0) {