We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
dzmmap
1 parent 5befca9 commit 1e61275Copy full SHA for 1e61275
src/util/memory.rs
@@ -8,6 +8,13 @@ pub fn zero(start: Address, len: usize) {
8
}
9
10
11
+/// Demand-zero mmap:
12
+/// This function guarantees to zero all mapped memory.
13
+///
14
+/// On linux, this is achieved by using the `MAP_ANON` mmap flag.
15
16
+/// ***TODO: Unimplemented for other OSes***
17
+#[cfg(target_os = "linux")]
18
pub fn dzmmap(start: Address, size: usize) -> Result<Address> {
19
let prot = libc::PROT_READ | libc::PROT_WRITE | libc::PROT_EXEC;
20
let flags = libc::MAP_ANON | libc::MAP_PRIVATE | libc::MAP_FIXED;
0 commit comments