Skip to content

Commit

Permalink
use region for mlock
Browse files Browse the repository at this point in the history
  • Loading branch information
radu committed Jun 22, 2024
1 parent 19b4b16 commit 4c24a69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ fn as_array<'a>(arr: &'a Bound<PyAny>, py: Python<'a>) -> PyResult<&'a [u8]> {
/// Calls the platform's underlying `mlock(2)` implementation.
unsafe fn _mlock(ptr: *mut u8, len: usize) -> bool {
println!("mlock {len} bytes");
memsec::mlock(ptr, len)
// region::lock(ptr, len).is_ok()
// memsec::mlock(ptr, len)
region::lock(ptr, len).is_ok()
}

/// Calls the platform's underlying `munlock(2)` implementation.
Expand Down

0 comments on commit 4c24a69

Please sign in to comment.