Skip to content

Simple LRU garbage collection for interned values #839

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 4, 2025
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,11 @@ salsa-macros = { version = "0.22.0", path = "components/salsa-macros", optional

boxcar = { version = "0.2.12" }
crossbeam-queue = "0.3.11"
dashmap = { version = "6", features = ["raw-api"] }
# the version of hashbrown used by dashmap
hashbrown_14 = { version = "0.14", package = "hashbrown" }
crossbeam-utils = "0.8.21"
hashbrown = "0.15"
hashlink = "0.10"
indexmap = "2"
intrusive-collections = "0.9.7"
parking_lot = "0.12"
portable-atomic = "1"
rustc-hash = "2"
Expand Down Expand Up @@ -52,6 +51,7 @@ salsa-macros = { version = "=0.22.0", path = "components/salsa-macros" }
[dev-dependencies]
# examples
crossbeam-channel = "0.5.14"
dashmap = { version = "6", features = ["raw-api"] }
eyre = "0.6.8"
notify-debouncer-mini = "0.4.1"
ordered-float = "4.2.1"
Expand Down
8 changes: 0 additions & 8 deletions src/durability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,14 +87,6 @@ impl Durability {
pub(crate) fn index(self) -> usize {
self.0 as usize
}

pub(crate) fn as_u8(self) -> u8 {
self.0 as u8
}

pub(crate) fn from_u8(value: u8) -> Self {
Self(DurabilityVal::from(value))
}
}

impl Default for Durability {
Expand Down
11 changes: 10 additions & 1 deletion src/event.rs
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,17 @@ pub enum EventKind {
revision: Revision,
},

/// Indicates that a value was interned by reusing an existing slot.
DidReuseInternedValue {
// The key of the interned value.
key: DatabaseKeyIndex,

// The revision the value was interned in.
revision: Revision,
},

/// Indicates that a previously interned value was read in a new revision.
DidReinternValue {
DidValidateInternedValue {
// The key of the interned value.
key: DatabaseKeyIndex,

Expand Down
1 change: 1 addition & 0 deletions src/function/memo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ pub struct Memo<V> {

// Memo's are stored a lot, make sure their size is doesn't randomly increase.
#[cfg(not(feature = "shuttle"))]
#[cfg(target_pointer_width = "64")]
const _: [(); std::mem::size_of::<Memo<std::num::NonZeroUsize>>()] =
[(); std::mem::size_of::<[usize; 13]>()];

Expand Down
Loading