diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-05-18 02:49:42 +0000 |
commit | 837b550238aa671a591ccf282dddeab29cadb206 (patch) | |
tree | 914b6b8862bace72bd3245ca184d374b08d8a672 /vendor/gix-tempfile/src | |
parent | Adding debian version 1.70.0+dfsg2-1. (diff) | |
download | rustc-837b550238aa671a591ccf282dddeab29cadb206.tar.xz rustc-837b550238aa671a591ccf282dddeab29cadb206.zip |
Merging upstream version 1.71.1+dfsg1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'vendor/gix-tempfile/src')
-rw-r--r-- | vendor/gix-tempfile/src/lib.rs | 3 | ||||
-rw-r--r-- | vendor/gix-tempfile/src/registry.rs | 3 | ||||
-rw-r--r-- | vendor/gix-tempfile/src/signal.rs | 3 |
3 files changed, 6 insertions, 3 deletions
diff --git a/vendor/gix-tempfile/src/lib.rs b/vendor/gix-tempfile/src/lib.rs index 8585c60b7..4d13d94b8 100644 --- a/vendor/gix-tempfile/src/lib.rs +++ b/vendor/gix-tempfile/src/lib.rs @@ -47,9 +47,10 @@ type HashMap<K, V> = dashmap::DashMap<K, V>; #[cfg(not(feature = "hp-hashmap"))] mod hashmap { - use parking_lot::Mutex; use std::collections::HashMap; + use parking_lot::Mutex; + // TODO(performance): use the `gix-hashtable` slot-map once available. It seems quite fast already though, so experiment. pub struct Concurrent<K, V> { inner: Mutex<HashMap<K, V>>, diff --git a/vendor/gix-tempfile/src/registry.rs b/vendor/gix-tempfile/src/registry.rs index 9eaab23a6..0e4117821 100644 --- a/vendor/gix-tempfile/src/registry.rs +++ b/vendor/gix-tempfile/src/registry.rs @@ -13,9 +13,10 @@ pub fn cleanup_tempfiles_signal_safe() { let current_pid = std::process::id(); #[cfg(feature = "hp-hashmap")] { - use crate::NEXT_MAP_INDEX; use std::sync::atomic::Ordering; + use crate::NEXT_MAP_INDEX; + let one_past_last_index = NEXT_MAP_INDEX.load(Ordering::SeqCst); for idx in 0..one_past_last_index { if let Some(entry) = REGISTRY.try_entry(idx) { diff --git a/vendor/gix-tempfile/src/signal.rs b/vendor/gix-tempfile/src/signal.rs index 3e0e7729c..79d9229ec 100644 --- a/vendor/gix-tempfile/src/signal.rs +++ b/vendor/gix-tempfile/src/signal.rs @@ -1,6 +1,7 @@ -use crate::REGISTRY; use once_cell::sync::Lazy; +use crate::REGISTRY; + /// Initialize signal handlers and other state to keep track of tempfiles, and **must be called before the first tempfile is created**, /// allowing to set the `mode` in which signal handlers are installed. /// |