Use boost::interprocess to memory-map 30GB file in various "chunks"?

907 Views Asked by At

I can memory-map a whole file using the boost::interprocess package:

boost::interprocess::file_mapping* fm = new file_mapping(FilePath, boost::interprocess::read_only);
boost::interprocess::mapped_region* mr = new mapped_region(*fm, boost::interprocess::read_only);
char* bytes = static_cast<char*>(mr->get_address());

However this maps the whole file. I have a 30GB file- which won't fit in to main memory. Is there any way I can use the same boost library to map from position 0 to x and then I can map again from position x+1 to 2*x etc?

0

There are 0 best solutions below