#include <cstdint>
#include <vector>
-#include <boost/unordered_map.hpp>
-#include <boost/unordered_set.hpp>
+#include <unordered_map>
+#include <unordered_set>
-#include "mc_mmu.h"
-#include "mc_forward.hpp"
+#include <xbt/base.h>
+
+#include "src/mc/mc_mmu.h"
+#include "src/mc/mc_forward.hpp"
namespace simgrid {
namespace mc {
/** @brief Storage for snapshot memory pages
*
* The first (lower) layer of the per-page snapshot mechanism is a page
- * store: it's responsibility is to store immutable shareable
- * reference-counted memory pages independently of the snapshoting
- * logic. Snapshot management and representation, soft-dirty tracking is
+ * store: its responsibility is to store immutable shareable
+ * reference-counted memory pages independently of the snapshotting
+ * logic. Snapshot management and representation is
* handled to an higher layer. READMORE
*
* Data structure:
// 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 boost::unordered_set<std::size_t> page_set_type;
- typedef boost::unordered_map<hash_type, page_set_type> pages_map_type;
+ typedef std::unordered_set<std::size_t> page_set_type;
+ typedef std::unordered_map<hash_type, page_set_type> pages_map_type;
private: // Fields:
/** First page */
void ref_page(size_t pageno);
/** @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
*
inline __attribute__((always_inline))
const void* PageStore::get_page(std::size_t pageno) const
{
- return mc_page_from_number(this->memory_, pageno);
+ return (void*) simgrid::mc::mmu::join(pageno, (std::uintptr_t) this->memory_);
}
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();
}