Skip to main content

llama_cpp_bindings/
mmap_supported.rs

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