Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some mmap options are not available on mac #53

Merged
merged 1 commit into from
Nov 10, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion keyvi/src/cpp/dictionary/fsa/automata.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
9 changes: 7 additions & 2 deletions keyvi/src/cpp/dictionary/fsa/internal/json_value_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 7 additions & 1 deletion keyvi/src/cpp/dictionary/fsa/internal/string_value_store.h
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down