Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[sonar] Fix casts to pointer type without const qualifier.
[simgrid.git] / src / mc / sosp / PageStore.hpp
index 02e9e07..0853b6d 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2015-2018. The SimGrid Team.  All rights reserved.         */
+/* Copyright (c) 2015-2019. 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. */
@@ -6,14 +6,12 @@
 #ifndef SIMGRID_MC_PAGESTORE_HPP
 #define SIMGRID_MC_PAGESTORE_HPP
 
-#include <cstdint>
-#include <vector>
+#include "src/mc/mc_forward.hpp"
+#include "src/mc/mc_mmu.hpp"
 
 #include <unordered_map>
 #include <unordered_set>
-
-#include "src/mc/mc_forward.hpp"
-#include "src/mc/mc_mmu.hpp"
+#include <vector>
 
 #ifndef XBT_ALWAYS_INLINE
 #define XBT_ALWAYS_INLINE inline __attribute__((always_inline))
@@ -36,7 +34,7 @@ namespace mc {
  *
  *    We want to keep this memory region aligned on the memory pages (so
  *    that we might be able to create non-linear memory mappings on those
- *    pages in the future) and be able to expand it without coyping the
+ *    pages in the future) and be able to expand it without copying the
  *    data (there will be a lot of pages here): we will be able to
  *    efficiently expand the memory mapping using `mremap()`, moving it
  *    to another virtual address if necessary.
@@ -130,7 +128,7 @@ public:
    * store.
    *
    * This will be the case if a page if soft clean: we know that is has not
-   * changed since the previous cnapshot/restoration and we can avoid
+   * changed since the previous snapshot/restoration and we can avoid
    * hashing the page, comparing byte-per-byte to candidates.
    * */
   void ref_page(size_t pageno);
@@ -143,7 +141,7 @@ public:
    *  @param pageno Number of the memory page in the store
    *  @return Start of the page
    */
-  const void* get_page(std::size_t pageno) const;
+  void* get_page(std::size_t pageno) const;
 
   // Debug/test methods
 
@@ -171,7 +169,7 @@ XBT_ALWAYS_INLINE void PageStore::ref_page(size_t pageno)
   ++this->page_counts_[pageno];
 }
 
-XBT_ALWAYS_INLINE const void* PageStore::get_page(std::size_t pageno) const
+XBT_ALWAYS_INLINE void* PageStore::get_page(std::size_t pageno) const
 {
   return (void*)simgrid::mc::mmu::join(pageno, (std::uintptr_t)this->memory_);
 }