Skip to content

Commit 1ea656f

Browse files
committed
Add a used fn
1 parent 2806a57 commit 1ea656f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/memory.rs

+6
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,12 @@ pub struct MemoryState {
1212
pub free: u64,
1313
}
1414

15+
impl MemoryState {
16+
pub fn used(&self) -> u64 {
17+
self.total - self.free
18+
}
19+
}
20+
1521
#[doc(alias = "ctl_mem_handle_t")]
1622
pub struct MemoryModule {
1723
pub(crate) control_lib: Arc<ControlLib>,

0 commit comments

Comments
 (0)