Skip to content

Commit

Permalink
Merge pull request #1354 from GuillaumeGomez/update
Browse files Browse the repository at this point in the history
Update CHANGELOG and crate version to 0.32.0
  • Loading branch information
GuillaumeGomez authored Oct 5, 2024
2 parents 2fb2903 + 0c5ca6a commit e022ae4
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 7 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
# 0.32.0

* Add new `Disk::is_read_only` API.
* Add new `remove_dead_processes` argument to `System::refresh_processes` and `System::refresh_processes_specifics`.
* macOS: Fix memory leak in disk refresh.

# 0.31.4

* macOS: Force memory cleanup in disk list retrieval.
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "sysinfo"
version = "0.31.4"
version = "0.32.0"
authors = ["Guillaume Gomez <guillaume1.gomez@gmail.com>"]
description = "Library to get system information such as processes, CPUs, disks, components and networks"
repository = "https://github.com/GuillaumeGomez/sysinfo"
Expand Down
8 changes: 8 additions & 0 deletions migration_guide.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Migration guide

## 0.31 to 0.32

### Major changes

`System::refresh_process` and `System::refresh_process_specifics` methods now take
an extra `remove_dead_processes` argument. When set to `true`, dead processes will
be removed.

## 0.30 to 0.31

With this update, the minimum supported Rust version goes up to 1.74.
Expand Down
4 changes: 2 additions & 2 deletions src/unix/apple/system.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,9 @@ pub(crate) struct SystemInner {
pub(crate) struct Wrap<'a>(pub UnsafeCell<&'a mut HashMap<Pid, Process>>);

#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
unsafe impl<'a> Send for Wrap<'a> {}
unsafe impl Send for Wrap<'_> {}
#[cfg(all(target_os = "macos", not(feature = "apple-sandbox")))]
unsafe impl<'a> Sync for Wrap<'a> {}
unsafe impl Sync for Wrap<'_> {}

fn boot_time() -> u64 {
let mut boot_time = timeval {
Expand Down
4 changes: 2 additions & 2 deletions src/unix/freebsd/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,9 +223,9 @@ pub(crate) struct WrapMap<'a>(
);

#[cfg(feature = "system")]
unsafe impl<'a> Send for WrapMap<'a> {}
unsafe impl Send for WrapMap<'_> {}
#[cfg(feature = "system")]
unsafe impl<'a> Sync for WrapMap<'a> {}
unsafe impl Sync for WrapMap<'_> {}

#[cfg(feature = "system")]
#[repr(transparent)]
Expand Down
4 changes: 2 additions & 2 deletions src/unix/linux/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,8 +351,8 @@ impl<'a, T> Wrap<'a, T> {
}

#[allow(clippy::non_send_fields_in_send_ty)]
unsafe impl<'a, T> Send for Wrap<'a, T> {}
unsafe impl<'a, T> Sync for Wrap<'a, T> {}
unsafe impl<T> Send for Wrap<'_, T> {}
unsafe impl<T> Sync for Wrap<'_, T> {}

#[inline(always)]
fn compute_start_time_without_boot_time(parts: &Parts<'_>, info: &SystemInfo) -> u64 {
Expand Down

0 comments on commit e022ae4

Please sign in to comment.