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.
|
const auto file_size = detail::query_file_size(handle, error); |
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
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.
mio/include/mio/detail/mmap.ipp
Line 336 in 8b6b7d8
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