All notable changes to mmap-rs will be documented in this file.
- Added support for
MADV_WILLNEEDandMADV_DONTNEEDon Android and Linux (PR#45). - Updated the Rust edition from 2021 to 2024.
- Updated the bitflags crate from version 1 to 2.
- Updated the thiserror crate from version 1 to 2.
- Updated the nix crate from version 0.26 to 0.30.
- Updated the sysctl crate from version 0.5 to 0.6.
- Bumped the MSRV (1.85).
- Fixed the type for major device ID to use
u16.
- Implemented
TryFromforMmapandReservedobjects for improved ergonomics. - Added the MSRV (1.67).
- Implemented
Debugfor all public types. - Added
MemoryAreas::query()and related functions to query a specific address or address range - Added
Mmap::split_off()and related functions to split an existing memory mapping at a page boundary. - Added
Mmap::merge()to merge adjacent memory mappings into one. - Added
MmapOptions::reserve()and related functions to reserve memory mappings instead of committing them. - Changed
MmapOptions::with_file()to require a reference to the file instead of taking ownership instead. - Documented flags that may have no operation on platforms that do not support the flag, such as
MmapFlags::STACKon Microsoft Windows. - Changed
MemoryAreas::query()to usemach_vm_region_recurse()on MacOS to recurse into submappings. - Changed
MmapFlags::COPY_ON_WRITEtoMmapFlags::SHARED, such that private memory mappings are the default and since copy-on-write semantics only make sense for file mappings. - Fixed an issue where
MemoryAreas::query()and related functions returned the wrongShareMode. - Removed
ShareMode::CopyOnWriteand useShareMode::Privateinstead. - Extended
MemoryAreas::query()to return the allocation base of the memory mapping. - Updated the windows crate from version 0.44 to 0.48.
- Implemented
MmapOptions::page_sizes()to return the supported page sizes for the platform. - Separated the functions to get the page size and the allocation granularity.
- Updated the windows crate from version 0.39 to 0.44.
- Changed
MmapOptions::new()to returnResult<Self, Error>rather thanSelfto support the use ofNonZeroUsizein nix. - Updated the nix crate from version 0.24 to 0.26.
- Added support for
i686-linux-android,aarch64-linux-android,x86_64-linux-androidandarmv7-linux-androideabi. - Added
MapFlags::TRANSPARENT_HUGE_PAGESto hint the kernel that it may merge pages within the mapping into huge pages if possible when set tomadvisemode. MmapOptions::with_flags()appends the flags instead of overriding them.- Implemented
SendandSyncforMmap.
- Added support for
i686-pc-windows-msvc,aarch64-pc-windows-msvc,aarch64-apple-ios,x86_64-apple-ios,armv7a-unknown-linux-gnueabihf,aarch64-unknown-linux-gnuandi686-unknown-linux-gnu. - Updated various dependencies.
- Relicensed under MIT and Apache.
- Added the
MemoryAreasiterator to iterate over the memory areas of a process. - Changed
UnsafeMmapFlags::MAP_JITtoUnsafeMmapFlags::JITto fix compilation on Mac OS X.