We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1b31489 commit e25ea79Copy full SHA for e25ea79
src/blocks/memory.rs
@@ -119,11 +119,9 @@ pub async fn run(config: Config, mut api: CommonApi) -> Result<()> {
119
// While zfs_arc_cache can be considered "available" memory,
120
// it can only free a maximum of (zfs_arc_cache - zfs_arc_min) amount.
121
// see https://github.com/htop-dev/htop/pull/1003
122
- let zfs_shrinkable_size = if mem_state.zfs_arc_cache > mem_state.zfs_arc_min {
123
- mem_state.zfs_arc_cache - mem_state.zfs_arc_min
124
- } else {
125
- 0
126
- } as f64;
+ let zfs_shrinkable_size = mem_state
+ .zfs_arc_cache
+ .saturating_sub(mem_state.zfs_arc_min) as f64;
127
let mem_avail = mem_avail + zfs_shrinkable_size;
128
129
let pagecache = mem_state.pagecache as f64 * 1024.;
0 commit comments