llama_cpp_bindings/mlock_supported.rs
1/// Is memory locking supported according to llama.cpp.
2///
3/// ```
4/// # use llama_cpp_bindings::mlock_supported;
5/// let mlock_supported = mlock_supported();
6/// if mlock_supported {
7/// println!("mlock_supported!");
8/// }
9/// ```
10#[must_use]
11pub fn mlock_supported() -> bool {
12 unsafe { llama_cpp_bindings_sys::llama_supports_mlock() }
13}
14
15#[cfg(test)]
16mod tests {
17 use super::mlock_supported;
18
19 #[test]
20 fn returns_bool_without_panic() {
21 let _supported: bool = mlock_supported();
22 }
23}