c++: How do I store and read an unordered_map in a memory mapped file

546 Views Asked by At

I would like to store and later read an unordered_map in a memory-mapped file using C++ on Solaris (compiler g++ 4.9.2). I have quite a large data that needs to be stored as a key-value pair. But, maintaining an unordered_map in memory takes up lot of memory at the same time key-value pair provides me access in O(1) time for the underlying data How can I use a memory mapped file using mmap to store and read data?

0

There are 0 best solutions below