fix: update use of sysinfo.system

System is now much quicker to start but requires an explicit call
to refresh memory else it deafults to 0 (oops)
This commit is contained in:
andy.boot
2023-01-04 19:45:33 +00:00
parent 72b811c278
commit a7b82f32d7

View File

@@ -208,8 +208,8 @@ fn main() {
fn init_rayon() -> Result<(), ThreadPoolBuildError> {
let large_stack = usize::pow(1024, 3);
// Warning: Creating System is slow, takes ~ 100ms
let s = System::new();
let mut s = System::new();
s.refresh_memory();
let available = s.available_memory();
if available > large_stack.try_into().unwrap() {