X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/c57842fe897f53b46f0be3da87f7c996674be7d6..41626f8a47c96f54fa3b1ee61a90fb0af699dcbc:/src/mc/mc_page_store.h diff --git a/src/mc/mc_page_store.h b/src/mc/mc_page_store.h index 8018016b2f..2f79705354 100644 --- a/src/mc/mc_page_store.h +++ b/src/mc/mc_page_store.h @@ -9,6 +9,7 @@ #ifdef __cplusplus #include +#include #include #include #include @@ -17,6 +18,7 @@ #include #include "mc_mmu.h" +#include "mc_forward.h" #ifndef MC_PAGE_STORE_H #define MC_PAGE_STORE_H @@ -78,10 +80,25 @@ struct s_mc_pages_store; * */ struct s_mc_pages_store { -private: // Types +public: // Types +#ifdef MC_PAGE_STORE_MD4 + typedef boost::array hash_type; +#else typedef uint64_t hash_type; - typedef boost ::unordered_set page_set_type; +#endif +private: // Types +#ifdef MC_PAGE_STORE_MD4 + // We are using a secure hash to identify a page. + // We assume there will not be any collision: we need to map a hash + // to a single page index. + typedef boost::unordered_map pages_map_type; +#else + // 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 page_set_type; typedef boost::unordered_map pages_map_type; +#endif private: // Fields: /** First page @@ -196,8 +213,7 @@ size_t s_mc_pages_store::capacity() { SG_BEGIN_DECL() -typedef struct s_mc_pages_store s_mc_pages_store_t, * mc_pages_store_t; -mc_pages_store_t mc_pages_store_new(); +mc_pages_store_t mc_pages_store_new(void); void mc_pages_store_delete(mc_pages_store_t store); /**