Public convenience wrapper for mlocking raw key bytes from `crypto.rs`. Locks `len` bytes starting at `ptr`. Best-effort: logs a warning on failure. No-op on non-Unix targets.
(ptr: *mut u8, len: usize)
| 55 | /// Locks `len` bytes starting at `ptr`. Best-effort: logs a warning on failure. |
| 56 | /// No-op on non-Unix targets. |
| 57 | pub fn mlock_key_bytes(ptr: *mut u8, len: usize) { |
| 58 | #[cfg(all(unix, not(target_arch = "wasm32")))] |
| 59 | mlock_best_effort(ptr as *mut libc::c_void, len); |
| 60 | #[cfg(not(all(unix, not(target_arch = "wasm32"))))] |
| 61 | let _ = (ptr, len); |
| 62 | } |
| 63 | |
| 64 | /// Attempt to mlock `len` bytes starting at `ptr`. |
| 65 | /// |
no test coverage detected