Function region::lock[][src]

pub fn lock(address: *const u8, size: usize) -> Result<LockGuard>

Locks one or more memory regions to RAM.

The memory pages within the address range is guaranteed to stay in RAM except for specials cases such as hibernation and memory starvation.

Examples

let data = [0; 100];
let _guard = region::lock(data.as_ptr(), data.len()).unwrap();