mio
mio copied to clipboard
Consider removing the file size check on mmap as it is redundant in most cases
Hi,
I believe it's quite redundant for mmap for check file boundaries as in most use cases, mmap offset and length is bounded by user already.
It should totally up to the user to make sure boundary is met.
So the below query file size can be removed.
https://github.com/vimpunk/mio/blob/8b6b7d878c89e81614d05edca7936de41ccdd2da/include/mio/detail/mmap.ipp#L336
I am working a request that open a gigabytes file in read only mode into thousands of small fragments (~4MB each) , if using mio, it would query the file size thousands of times for nothing.
The boost v1.83.0 mapped_region (which does similar thing to mio) has skipped file size check and simply mapped the file