Skip to content

Commit

Permalink
Merge pull request #1489 from jqnatividad/bump-sysinfo-0.30
Browse files Browse the repository at this point in the history
Bump sysinfo 0.30
  • Loading branch information
jqnatividad authored Dec 21, 2023
2 parents 3293d20 + 9df333f commit 22eceb9
Show file tree
Hide file tree
Showing 5 changed files with 70 additions and 48 deletions.
94 changes: 59 additions & 35 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ snap = "1"
strsim = { version = "0.10", optional = true }
strum = { version = "0.25", features = ["phf"] }
strum_macros = "0.25"
sysinfo = "0.29"
sysinfo = "0.30"
tabwriter = "1.3"
tempfile = "3"
test-data-generation = { version = "0.3", optional = true }
Expand Down
5 changes: 3 additions & 2 deletions src/cmd/extdedup.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,9 @@ use std::{

use indicatif::HumanCount;
use serde::Deserialize;
use sysinfo::{System, SystemExt};
use sysinfo::System;

// use sysinfo::System::sysinfo;
use crate::{config, odhtcache, util, CliResult};

#[derive(Deserialize)]
Expand All @@ -63,7 +64,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
// if we can detect the total memory, use 10% of it by default
// and up to --memory-limit (capped at 50%),
// otherwise, if we cannot detect the free memory use a default of 100 MB
let mem_limited_buffer = if System::IS_SUPPORTED {
let mem_limited_buffer = if sysinfo::IS_SUPPORTED_SYSTEM {
let mut sys = System::new();
sys.refresh_memory();
(sys.total_memory() * 1000) / u8::min(args.flag_memory_limit.unwrap_or(10), 50) as u64
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/extsort.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ use std::{

use ext_sort::{buffer::mem::MemoryLimitedBufferBuilder, ExternalSorter, ExternalSorterBuilder};
use serde::Deserialize;
use sysinfo::{System, SystemExt};
use sysinfo::System;

use crate::{config, util, CliResult};

Expand Down Expand Up @@ -70,7 +70,7 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
// if we can detect the total memory, use 10% of it by default
// and up to --memory-limit (capped at 50%),
// otherwise, if we cannot detect the free memory use a default of 100 MB
let mem_limited_buffer = if System::IS_SUPPORTED {
let mem_limited_buffer = if sysinfo::IS_SUPPORTED_SYSTEM {
let mut sys = System::new();
sys.refresh_memory();
(sys.total_memory() * 1000) / u8::min(args.flag_memory_limit.unwrap_or(10), 50) as u64
Expand Down
Loading

0 comments on commit 22eceb9

Please sign in to comment.