diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 12:19:43 +0000 |
commit | 3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245 (patch) | |
tree | daf049b282ab10e8c3d03e409b3cd84ff3f7690c /vendor/memmap2 | |
parent | Adding debian version 1.68.2+dfsg1-1. (diff) | |
download | rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.tar.xz rustc-3e3e70d529d8c7d7c4d7bc4fefc9f109393b9245.zip |
Merging upstream version 1.69.0+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/memmap2')
-rw-r--r-- | vendor/memmap2/.cargo-checksum.json | 2 | ||||
-rw-r--r-- | vendor/memmap2/CHANGELOG.md | 9 | ||||
-rw-r--r-- | vendor/memmap2/Cargo.lock | 2 | ||||
-rw-r--r-- | vendor/memmap2/Cargo.toml | 4 | ||||
-rw-r--r-- | vendor/memmap2/src/lib.rs | 34 |
5 files changed, 44 insertions, 7 deletions
diff --git a/vendor/memmap2/.cargo-checksum.json b/vendor/memmap2/.cargo-checksum.json index c189c8a9c..656d284c6 100644 --- a/vendor/memmap2/.cargo-checksum.json +++ b/vendor/memmap2/.cargo-checksum.json @@ -1 +1 @@ -{"files":{"CHANGELOG.md":"fb280b4d71ea601557e7ab637a7f82f73eb519dd9d16d38684bf6fe4e800a020","Cargo.lock":"80c9c7be560eee59e3eded68a49b53278198fc23495807c6a22e9c5190914ebe","Cargo.toml":"4738a7e9e1f236b95d41ef8837c351f895fcb1cc1cb82ab7e3bf39c72849cba4","LICENSE-APACHE":"04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad","LICENSE-MIT":"0d25d03b5ab49576178ad0cae7a2648d12c17ad0452fe49c07e55e4b59aa5257","README.md":"c7b3cd928f0d1a10faa255e2f84a2a06636e55ea3e7edd4f6334dd9215151205","examples/cat.rs":"ab0b575d19662e2d5b6c7cea2756b57530e495d56acdb4fd2b56c0ba4d768dfd","src/advice.rs":"194bfd6a32495f6b0c739d083b06230ae656927767f15c1b49b245b63431cc4d","src/lib.rs":"ea214bce1c2409b8ee7a390c85f5114bc681a551d02aba23280030fe58588eb9","src/stub.rs":"f276bb5e4bc29c2129ebc660b01a1de173b9575e2e866ea5a34e0ee6318f1177","src/unix.rs":"03fe91a320d0146993019ea51e486275b8c8e13e42a995e649b8c76690e3f167","src/windows.rs":"bbb39200ac35b5517626c12efad4886f7b5d34e56256284914c556dec1567e38"},"package":"95af15f345b17af2efc8ead6080fb8bc376f8cec1b35277b935637595fe77498"}
\ No newline at end of file +{"files":{"CHANGELOG.md":"2c44b332748c22db37c7bc17f8c90edd5616c084a9b7238eef5067f3dd287813","Cargo.lock":"ed33b2c7bd22c158bd527fefa4079e62a3e98a63c2b653ba50d977a8a43f92c2","Cargo.toml":"cad69c38d627420a71d549945b9bbc4b21323b2855d63e3b98d344d2fe3ea07e","LICENSE-APACHE":"04ea4849dba9dcae07113850c6f1b1a69052c625210639914eee352023f750ad","LICENSE-MIT":"0d25d03b5ab49576178ad0cae7a2648d12c17ad0452fe49c07e55e4b59aa5257","README.md":"c7b3cd928f0d1a10faa255e2f84a2a06636e55ea3e7edd4f6334dd9215151205","examples/cat.rs":"ab0b575d19662e2d5b6c7cea2756b57530e495d56acdb4fd2b56c0ba4d768dfd","src/advice.rs":"194bfd6a32495f6b0c739d083b06230ae656927767f15c1b49b245b63431cc4d","src/lib.rs":"4f345df103c78344e07454da7b8f3941af094efd599e3d51a29ea735fab19dba","src/stub.rs":"f276bb5e4bc29c2129ebc660b01a1de173b9575e2e866ea5a34e0ee6318f1177","src/unix.rs":"03fe91a320d0146993019ea51e486275b8c8e13e42a995e649b8c76690e3f167","src/windows.rs":"bbb39200ac35b5517626c12efad4886f7b5d34e56256284914c556dec1567e38"},"package":"4b182332558b18d807c4ce1ca8ca983b34c3ee32765e47b3f0f69b90355cc1dc"}
\ No newline at end of file diff --git a/vendor/memmap2/CHANGELOG.md b/vendor/memmap2/CHANGELOG.md index 14f481c4e..07b4eb270 100644 --- a/vendor/memmap2/CHANGELOG.md +++ b/vendor/memmap2/CHANGELOG.md @@ -6,6 +6,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ## [Unreleased] +## [0.5.8] - 2022-11-09 +### Added +- `MmapRaw::advise`, `MmapRaw::lock` and `MmapRaw::unlock`. + [@diwic](https://github.com/diwic) +- Improve `MmapMut::make_exec` documentation. + ## [0.5.7] - 2022-08-15 ### Changed - Simplify file size retrieving code. @@ -117,7 +123,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/). ### Removed - `winapi` dependency. [memmap-rs/pull/89](https://github.com/danburkert/memmap-rs/pull/89) -[Unreleased]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.7...HEAD +[Unreleased]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.8...HEAD +[0.5.8]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.7...v0.5.8 [0.5.7]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.6...v0.5.7 [0.5.6]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.5...v0.5.6 [0.5.5]: https://github.com/RazrFalcon/memmap2-rs/compare/v0.5.4...v0.5.5 diff --git a/vendor/memmap2/Cargo.lock b/vendor/memmap2/Cargo.lock index 5a4a2b5f2..f5fe93bb2 100644 --- a/vendor/memmap2/Cargo.lock +++ b/vendor/memmap2/Cargo.lock @@ -40,7 +40,7 @@ checksum = "a7f823d141fe0a24df1e23b4af4e3c7ba9e5966ec514ea068c93024aa7deb765" [[package]] name = "memmap2" -version = "0.5.7" +version = "0.5.8" dependencies = [ "libc", "owning_ref", diff --git a/vendor/memmap2/Cargo.toml b/vendor/memmap2/Cargo.toml index 29d796270..9c3575f9b 100644 --- a/vendor/memmap2/Cargo.toml +++ b/vendor/memmap2/Cargo.toml @@ -12,7 +12,7 @@ [package] edition = "2018" name = "memmap2" -version = "0.5.7" +version = "0.5.8" authors = [ "Dan Burkert <dan@danburkert.com>", "Yevhenii Reizner <razrfalcon@gmail.com>", @@ -26,7 +26,7 @@ keywords = [ "io", "file", ] -license = "MIT/Apache-2.0" +license = "MIT OR Apache-2.0" repository = "https://github.com/RazrFalcon/memmap2-rs" [dependencies.stable_deref_trait] diff --git a/vendor/memmap2/src/lib.rs b/vendor/memmap2/src/lib.rs index 0b92ea0e1..58df7589b 100644 --- a/vendor/memmap2/src/lib.rs +++ b/vendor/memmap2/src/lib.rs @@ -800,6 +800,30 @@ impl MmapRaw { pub fn flush_async_range(&self, offset: usize, len: usize) -> Result<()> { self.inner.flush_async(offset, len) } + + /// Advise OS how this memory map will be accessed. Only supported on Unix. + /// + /// See [madvise()](https://man7.org/linux/man-pages/man2/madvise.2.html) map page. + #[cfg(unix)] + pub fn advise(&self, advice: Advice) -> Result<()> { + self.inner.advise(advice) + } + + /// Lock the whole memory map into RAM. Only supported on Unix. + /// + /// See [mlock()](https://man7.org/linux/man-pages/man2/mlock.2.html) map page. + #[cfg(unix)] + pub fn lock(&mut self) -> Result<()> { + self.inner.lock() + } + + /// Unlock the whole memory map. Only supported on Unix. + /// + /// See [munlock()](https://man7.org/linux/man-pages/man2/munlock.2.html) map page. + #[cfg(unix)] + pub fn unlock(&mut self) -> Result<()> { + self.inner.unlock() + } } impl fmt::Debug for MmapRaw { @@ -1006,6 +1030,12 @@ impl MmapMut { /// /// If the memory map is file-backed, the file must have been opened with execute permissions. /// + /// On systems with separate instructions and data caches (a category that includes many ARM + /// chips), a platform-specific call may be needed to ensure that the changes are visible to the + /// execution unit (e.g. when using this function to implement a JIT compiler). For more + /// details, see [this ARM write-up](https://community.arm.com/arm-community-blogs/b/architectures-and-processors-blog/posts/caches-and-self-modifying-code) + /// or the `man` page for [`sys_icache_invalidate`](https://developer.apple.com/library/archive/documentation/System/Conceptual/ManPages_iPhoneOS/man3/sys_icache_invalidate.3.html). + /// /// # Errors /// /// This method returns an error when the underlying system call fails, which can happen for a @@ -1088,7 +1118,7 @@ mod test { #[cfg(unix)] use crate::advice::Advice; - use std::fs::{self, OpenOptions}; + use std::fs::OpenOptions; use std::io::{Read, Write}; #[cfg(unix)] use std::os::unix::io::AsRawFd; @@ -1622,7 +1652,7 @@ mod test { /// Returns true if a non-zero amount of memory is locked. #[cfg(target_os = "linux")] fn is_locked() -> bool { - let status = &fs::read_to_string("/proc/self/status") + let status = &std::fs::read_to_string("/proc/self/status") .expect("/proc/self/status should be available"); for line in status.lines() { if line.starts_with("VmLck:") { |