X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/19b3962253112b19308537bc2400de141c119d99..1d83468696010801d74f8bc1e8c30918ffebabac:/src/mc/PageStore.hpp diff --git a/src/mc/PageStore.hpp b/src/mc/PageStore.hpp index 640e63c9e4..da9d527c74 100644 --- a/src/mc/PageStore.hpp +++ b/src/mc/PageStore.hpp @@ -1,4 +1,4 @@ -/* 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 @@ -13,10 +13,10 @@ #include #include -#include +#include "xbt/base.h" -#include "src/mc/mc_mmu.h" #include "src/mc/mc_forward.hpp" +#include "src/mc/mc_mmu.hpp" namespace simgrid { namespace mc { @@ -75,14 +75,16 @@ namespace mc { class PageStore { public: // Types typedef std::uint64_t hash_type; -private: // Types + +private: + // Types // We are using a cheap hash to index a page. // We should expect collision and we need to associate multiple page indices // to the same hash. typedef std::unordered_set page_set_type; typedef std::unordered_map pages_map_type; -private: // Fields: + // Fields: /** First page */ void* memory_; /** Number of available pages in virtual memory */ @@ -96,18 +98,19 @@ private: // Fields: /** Index from page hash to page index */ pages_map_type hash_index_; -private: // Methods + // Methods void resize(std::size_t size); std::size_t alloc_page(); void remove_page(std::size_t pageno); -public: // Constructors +public: + // Constructors PageStore(PageStore const&) = delete; PageStore& operator=(PageStore const&) = delete; explicit PageStore(std::size_t size); ~PageStore(); -public: // Methods + // Methods /** @brief Decrement the reference count for a given page * @@ -141,7 +144,7 @@ public: // Methods */ const void* get_page(std::size_t pageno) const; -public: // Debug/test methods + // Debug/test methods /** @brief Get the number of references for a page */ std::size_t get_ref(std::size_t pageno);