diff --git a/keyvi/src/cpp/dictionary/fsa/automata.h b/keyvi/src/cpp/dictionary/fsa/automata.h index 010833ef..4ef0fcae 100644 --- a/keyvi/src/cpp/dictionary/fsa/automata.h +++ b/keyvi/src/cpp/dictionary/fsa/automata.h @@ -84,10 +84,16 @@ final { throw std::invalid_argument("file is corrupt(truncated)"); } - boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options | MAP_HUGETLB; + boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options; + +#ifdef MAP_HUGETLB + map_options |= MAP_HUGETLB; +#endif if (!load_lazy) { +#ifdef MAP_POPULATE map_options |= MAP_POPULATE; +#endif } TRACE("labels start offset: %d", offset); diff --git a/keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h b/keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h index e8295354..0780d3bf 100644 --- a/keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h +++ b/keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h @@ -410,11 +410,16 @@ class JsonValueStoreReader final: public IValueStoreReader { } } - boost::interprocess::map_options_t map_options = - boost::interprocess::default_map_options | MAP_HUGETLB; + boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options; + +#ifdef MAP_HUGETLB + map_options |= MAP_HUGETLB; +#endif if (!load_lazy) { +#ifdef MAP_POPULATE map_options |= MAP_POPULATE; +#endif } strings_region_ = new boost::interprocess::mapped_region( diff --git a/keyvi/src/cpp/dictionary/fsa/internal/json_value_store_deprecated.h b/keyvi/src/cpp/dictionary/fsa/internal/json_value_store_deprecated.h index 90c84619..4cd276fa 100644 --- a/keyvi/src/cpp/dictionary/fsa/internal/json_value_store_deprecated.h +++ b/keyvi/src/cpp/dictionary/fsa/internal/json_value_store_deprecated.h @@ -353,10 +353,16 @@ class JsonValueStoreDeprecated final : public IValueStoreWriter { } } - boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options | MAP_HUGETLB; + boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options; + +#ifdef MAP_HUGETLB + map_options |= MAP_HUGETLB; +#endif if (!load_lazy) { +#ifdef MAP_POPULATE map_options |= MAP_POPULATE; +#endif } strings_region_ = new boost::interprocess::mapped_region( diff --git a/keyvi/src/cpp/dictionary/fsa/internal/string_value_store.h b/keyvi/src/cpp/dictionary/fsa/internal/string_value_store.h index 192804a9..98130cb9 100644 --- a/keyvi/src/cpp/dictionary/fsa/internal/string_value_store.h +++ b/keyvi/src/cpp/dictionary/fsa/internal/string_value_store.h @@ -243,10 +243,16 @@ class StringValueStore final : public IValueStoreWriter { } } - boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options | MAP_HUGETLB; + boost::interprocess::map_options_t map_options = boost::interprocess::default_map_options; + +#ifdef MAP_HUGETLB + map_options |= MAP_HUGETLB; +#endif if (!load_lazy) { +#ifdef MAP_POPULATE map_options |= MAP_POPULATE; +#endif } strings_region_ = new boost::interprocess::mapped_region(