From bacf16e1f1e330e546d73367cdf2175a02173cf0 Mon Sep 17 00:00:00 2001 From: Carterpersall Date: Mon, 13 Mar 2023 12:58:21 -0500 Subject: [PATCH] Initial Implementation It just uses existing functions and subtracts the used memory from the total --- src/windows/mod.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/windows/mod.rs b/src/windows/mod.rs index 8256600e..a1da9968 100644 --- a/src/windows/mod.rs +++ b/src/windows/mod.rs @@ -110,7 +110,14 @@ impl MemoryReadout for WindowsMemoryReadout { } fn free(&self) -> Result { - Err(ReadoutError::NotImplemented) + // Subtract used memory from total memory + match self.total() { + Ok(total) => match self.used() { + Ok(used) => Ok(total - used), + Err(e) => Err(e), + }, + Err(e) => Err(e), + } } fn buffers(&self) -> Result {