MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / mlock_graceful_on_linux

Function mlock_graceful_on_linux

nodedb-wal/src/secure_mem.rs:110–117  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

108 #[test]
109 #[cfg(all(unix, not(target_arch = "wasm32")))]
110 fn mlock_graceful_on_linux() {
111 // mlock with a stack pointer that may or may not succeed depending on
112 // RLIMIT_MEMLOCK. Either way we must not panic.
113 let mut buf = [0u8; 32];
114 mlock_best_effort(buf.as_mut_ptr() as *mut libc::c_void, 32);
115 munlock_best_effort(buf.as_mut_ptr() as *mut libc::c_void, 32);
116 // Success = no panic.
117 }
118}

Callers

nothing calls this directly

Calls 3

mlock_best_effortFunction · 0.85
munlock_best_effortFunction · 0.85
as_mut_ptrMethod · 0.45

Tested by

no test coverage detected