X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1fc042e8bc9c51f9267fa1936deaebe59ae01ee7..c2184f1318115fcea2571f738e8359044bc78d42:/src/mc/PageStore.hpp diff --git a/src/mc/PageStore.hpp b/src/mc/PageStore.hpp index 4ae359f90b..da9d527c74 100644 --- a/src/mc/PageStore.hpp +++ b/src/mc/PageStore.hpp @@ -1,4 +1,4 @@ -/* Copyright (c) 2015-2017. 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 @@ -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);