diff --git a/dumpster/Cargo.toml b/dumpster/Cargo.toml index 8e267d6..c70860c 100644 --- a/dumpster/Cargo.toml +++ b/dumpster/Cargo.toml @@ -16,9 +16,8 @@ coerce-unsized = [] derive = ["dep:dumpster_derive"] [dependencies] -once_cell = "1.18.0" parking_lot = "0.12" -dumpster_derive = {version = "0.2.0", path = "../dumpster_derive", optional = true} +dumpster_derive = { version = "0.2.0", path = "../dumpster_derive", optional = true } [dev-dependencies] fastrand = "2.0.0" @@ -29,4 +28,4 @@ features = ["derive"] [package.metadata.docs.rs] features = ["derive"] targets = ["x86_64-unknown-linux-gnu"] -rustdoc-args = ["--generate-link-to-definition"] \ No newline at end of file +rustdoc-args = ["--generate-link-to-definition"] diff --git a/dumpster/src/sync/collect.rs b/dumpster/src/sync/collect.rs index b1affde..523bf22 100644 --- a/dumpster/src/sync/collect.rs +++ b/dumpster/src/sync/collect.rs @@ -14,13 +14,14 @@ use std::{ collections::{hash_map::Entry, HashMap}, mem::{replace, swap, take, transmute}, ptr::{drop_in_place, NonNull}, - sync::atomic::{AtomicPtr, AtomicUsize, Ordering}, + sync::{ + atomic::{AtomicPtr, AtomicUsize, Ordering}, + LazyLock, + }, }; use parking_lot::{Mutex, RwLock}; -use once_cell::sync::Lazy; - use crate::{ptr::Erased, Collectable, Visitor}; use super::{default_collect_condition, CollectCondition, CollectInfo, Gc, GcBox, CURRENT_TAG}; @@ -102,7 +103,7 @@ enum Reachability { /// The global garbage truck. /// All [`TrashCans`] should eventually end up in here. -static GARBAGE_TRUCK: Lazy = Lazy::new(|| GarbageTruck { +static GARBAGE_TRUCK: LazyLock = LazyLock::new(|| GarbageTruck { contents: Mutex::new(HashMap::new()), collecting_lock: RwLock::new(()), n_gcs_dropped: AtomicUsize::new(0),