heim_memory/os/
macos.rs

1//! MacOS specific extensions for crate types.
2
3use heim_common::units::Information;
4
5/// MacOS-specific extension to [`Memory`]
6pub trait MemoryExt {
7    /// Returns memory currently in use or very recently used, and so it is in RAM.
8    fn active(&self) -> Information;
9
10    /// Returns memory that is marked as not used.
11    fn inactive(&self) -> Information;
12
13    /// Returns memory that is marked to always stay in RAM. It is never moved to disk.
14    fn wire(&self) -> Information;
15}
16
17#[cfg(target_os = "macos")]
18impl MemoryExt for crate::Memory {
19    fn active(&self) -> Information {
20        self.as_ref().active()
21    }
22
23    fn inactive(&self) -> Information {
24        self.as_ref().inactive()
25    }
26
27    fn wire(&self) -> Information {
28        self.as_ref().wire()
29    }
30}