ROADMAP v0.2.0 - Memory usage ratio for adaptive behavior (see ROADMAP.md §1)
(&self)
| 180 | /// - >1.0 = over budget (should not happen) |
| 181 | #[allow(dead_code)] // ROADMAP v0.2.0 - Memory usage ratio for adaptive behavior (see ROADMAP.md §1) |
| 182 | pub fn usage_ratio(&self) -> f64 { |
| 183 | if self.limit == 0 { |
| 184 | return 0.0; |
| 185 | } |
| 186 | self.allocated() as f64 / self.limit as f64 |
| 187 | } |
| 188 | |
| 189 | /// Check if we're approaching the memory limit |
| 190 | /// |
no test coverage detected