You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For the build_raw() alternative of the MmapRegion,
the implementation was validating that the length of
the mapping was a multiple of the page size.
This generally makes sense, since the OS will round up
to the nearest multiple anyway and only allocate full
pages.
There is one corner case though where this needs to be
relaxed: when mapping a file with a length not divisible
by the pagesize.
According to the POSIX reference, the length will be rounded
up and the extra memory zero-ed. Memory accesses will work
as expected, even beyond the actual file length (but within the
allocated memory), but any writes will not be persisted to the
filesystem and the backing device.
This is a use case where mapping an "uneven" length makes sense,
so that such "out-of-bounds" checks can be caught by accesses
via vm-memory primitives.
This commit removes this constraint.
Signed-off-by: alindima <[email protected]>
0 commit comments