From 4c24a6949d747ffb566633ed7243469af54870d6 Mon Sep 17 00:00:00 2001 From: radu Date: Sat, 22 Jun 2024 18:29:22 +0300 Subject: [PATCH] use region for mlock --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 073edeb..4648d50 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -106,8 +106,8 @@ fn as_array<'a>(arr: &'a Bound, 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.