Support partial mapping in GMappedFile
Submitted by Mathias Hasselmann (IRC: tbf)
Link to original bug (#407544)
Description
GMappedFile does only allow mapping of complete files. When using memory mapped files for implementing caches it is useful to map only some portion of the file into memory. For that purpose the mmap sys-call of POSIX and the MapViewOfFileEx call of Win32 support an offset parameter.
Therefore I'd like to see a new constructor for GMappedKeyFile allowing to pass offset and length of the mapped region:
g_mapped_file_new_full(const gchar *filename, gsize offset, gsize length);
I am willing to cook the patch, if that API request is accepted.
Version: 2.12.x