Auto merge of #2520 - saethlin:mmap-shim, r=RalfJung

mmap/munmap/mremamp shims

This adds basic support for `mmap`/`mremap`/`munmap`, with the specific goal of testing allocators targeting Linux under Miri.

This supports `mmap` with `MAP_PRIVATE|MAP_ANONYMOUS`, and `PROT_READ|PROT_WRITE`, and explicitly does not support `MAP_SHARED` (because that's asking for MMIO) as well as any kind of file mapping (because it seems like nobody does `MAP_PRIVATE` on files even though that would be very sensible). And (officially) we don't support `MAP_FIXED`, so we always ignore the `addr` argument.

This supports `mremap` only when the implementation is allowed to move the mapping (so no `MREMAP_FIXED`, no `MREMAP_DONTUNMAP`, and required `MREMAP_MAYMOVE`), and also when the entirety of a region previously mapped by `mmap` is being remapped.

This supports `munmap` but only when the entirety of a region previously mapped by `mmap` is unmapped.
This commit is contained in:
bors 2023-06-20 14:18:46 +00:00
commit c72a5ce8e4

Diff content is not available