Skip to content

Commit

Permalink
remove once_cell dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
claytonwramsey committed Aug 20, 2024
1 parent 4c92253 commit 11d890a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions dumpster/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -29,4 +28,4 @@ features = ["derive"]
[package.metadata.docs.rs]
features = ["derive"]
targets = ["x86_64-unknown-linux-gnu"]
rustdoc-args = ["--generate-link-to-definition"]
rustdoc-args = ["--generate-link-to-definition"]
9 changes: 5 additions & 4 deletions dumpster/src/sync/collect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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};
Expand Down Expand Up @@ -102,7 +103,7 @@ enum Reachability {

/// The global garbage truck.
/// All [`TrashCans`] should eventually end up in here.
static GARBAGE_TRUCK: Lazy<GarbageTruck> = Lazy::new(|| GarbageTruck {
static GARBAGE_TRUCK: LazyLock<GarbageTruck> = LazyLock::new(|| GarbageTruck {
contents: Mutex::new(HashMap::new()),
collecting_lock: RwLock::new(()),
n_gcs_dropped: AtomicUsize::new(0),
Expand Down

0 comments on commit 11d890a

Please sign in to comment.