rename local_state to zalsa_local

This commit is contained in:
Niko Matsakis 2024-07-28 13:12:58 +00:00
parent 3254f46ca8
commit ab112b7126
25 changed files with 28 additions and 28 deletions

View file

@ -10,7 +10,7 @@ use crate::{
hash::FxDashMap, hash::FxDashMap,
ingredient::{fmt_index, Ingredient, Jar}, ingredient::{fmt_index, Ingredient, Jar},
key::DependencyIndex, key::DependencyIndex,
local_state::{QueryOrigin, ZalsaLocal}, zalsa_local::{QueryOrigin, ZalsaLocal},
zalsa::IngredientIndex, zalsa::IngredientIndex,
Database, DatabaseKeyIndex, Event, EventKind, Id, Revision, Database, DatabaseKeyIndex, Event, EventKind, Id, Revision,
}; };

View file

@ -2,12 +2,12 @@ use crate::{
durability::Durability, durability::Durability,
hash::{FxIndexMap, FxIndexSet}, hash::{FxIndexMap, FxIndexSet},
key::{DatabaseKeyIndex, DependencyIndex}, key::{DatabaseKeyIndex, DependencyIndex},
local_state::EMPTY_DEPENDENCIES, zalsa_local::EMPTY_DEPENDENCIES,
tracked_struct::Disambiguator, tracked_struct::Disambiguator,
Cycle, Revision, Cycle, Revision,
}; };
use super::local_state::{EdgeKind, QueryEdges, QueryOrigin, QueryRevisions}; use super::zalsa_local::{EdgeKind, QueryEdges, QueryOrigin, QueryRevisions};
#[derive(Debug)] #[derive(Debug)]
pub(crate) struct ActiveQuery { pub(crate) struct ActiveQuery {

View file

@ -4,7 +4,7 @@ use parking_lot::{Condvar, Mutex};
use crate::{ use crate::{
self as salsa, self as salsa,
local_state::{self, ZalsaLocal}, zalsa_local::{self, ZalsaLocal},
zalsa::Zalsa, zalsa::Zalsa,
Durability, Event, EventKind, Revision, Durability, Event, EventKind, Revision,
}; };
@ -120,7 +120,7 @@ pub struct DatabaseImpl<U: UserData = ()> {
coordinate: Arc<Coordinate>, coordinate: Arc<Coordinate>,
/// Per-thread state /// Per-thread state
zalsa_local: local_state::ZalsaLocal, zalsa_local: zalsa_local::ZalsaLocal,
/// The `U` is stored as a `dyn Any` in `zalsa_impl` /// The `U` is stored as a `dyn Any` in `zalsa_impl`
phantom: PhantomData<U>, phantom: PhantomData<U>,

View file

@ -4,7 +4,7 @@ use crossbeam::atomic::AtomicCell;
use crate::{ use crate::{
cycle::CycleRecoveryStrategy, ingredient::fmt_index, key::DatabaseKeyIndex, cycle::CycleRecoveryStrategy, ingredient::fmt_index, key::DatabaseKeyIndex,
local_state::QueryOrigin, salsa_struct::SalsaStructInDb, zalsa::IngredientIndex, zalsa_local::QueryOrigin, salsa_struct::SalsaStructInDb, zalsa::IngredientIndex,
AsDynDatabase as _, Cycle, Database, Event, EventKind, Id, Revision, AsDynDatabase as _, Cycle, Database, Event, EventKind, Id, Revision,
}; };

View file

@ -1,4 +1,4 @@
use crate::local_state::QueryRevisions; use crate::zalsa_local::QueryRevisions;
use super::{memo::Memo, Configuration, IngredientImpl}; use super::{memo::Memo, Configuration, IngredientImpl};

View file

@ -1,7 +1,7 @@
use arc_swap::ArcSwap; use arc_swap::ArcSwap;
use crossbeam::queue::SegQueue; use crossbeam::queue::SegQueue;
use crate::{local_state::QueryOrigin, Id}; use crate::{zalsa_local::QueryOrigin, Id};
use super::{memo, Configuration, IngredientImpl}; use super::{memo, Configuration, IngredientImpl};

View file

@ -1,5 +1,5 @@
use crate::{ use crate::{
hash::FxHashSet, key::DependencyIndex, local_state::QueryRevisions, AsDynDatabase as _, hash::FxHashSet, key::DependencyIndex, zalsa_local::QueryRevisions, AsDynDatabase as _,
DatabaseKeyIndex, Event, EventKind, DatabaseKeyIndex, Event, EventKind,
}; };

View file

@ -1,7 +1,7 @@
use std::sync::Arc; use std::sync::Arc;
use crate::{ use crate::{
local_state::ActiveQueryGuard, runtime::StampedValue, Cycle, Database, Event, EventKind, zalsa_local::ActiveQueryGuard, runtime::StampedValue, Cycle, Database, Event, EventKind,
}; };
use super::{memo::Memo, Configuration, IngredientImpl}; use super::{memo::Memo, Configuration, IngredientImpl};

View file

@ -1,7 +1,7 @@
use arc_swap::Guard; use arc_swap::Guard;
use crate::{ use crate::{
local_state::ZalsaLocal, runtime::StampedValue, AsDynDatabase as _, Database as _, Id, zalsa_local::ZalsaLocal, runtime::StampedValue, AsDynDatabase as _, Database as _, Id,
}; };
use super::{Configuration, IngredientImpl}; use super::{Configuration, IngredientImpl};

View file

@ -1,4 +1,4 @@
use crate::{local_state::QueryOrigin, Id}; use crate::{zalsa_local::QueryOrigin, Id};
use super::{Configuration, IngredientImpl}; use super::{Configuration, IngredientImpl};

View file

@ -2,7 +2,7 @@ use arc_swap::Guard;
use crate::{ use crate::{
key::DatabaseKeyIndex, key::DatabaseKeyIndex,
local_state::{ActiveQueryGuard, EdgeKind, QueryOrigin, ZalsaLocal}, zalsa_local::{ActiveQueryGuard, EdgeKind, QueryOrigin, ZalsaLocal},
runtime::StampedValue, runtime::StampedValue,
zalsa::Zalsa, zalsa::Zalsa,
AsDynDatabase as _, Database, Id, Revision, AsDynDatabase as _, Database, Id, Revision,

View file

@ -4,7 +4,7 @@ use arc_swap::{ArcSwap, Guard};
use crossbeam::atomic::AtomicCell; use crossbeam::atomic::AtomicCell;
use crate::{ use crate::{
hash::FxDashMap, key::DatabaseKeyIndex, local_state::QueryRevisions, zalsa::Zalsa, Event, hash::FxDashMap, key::DatabaseKeyIndex, zalsa_local::QueryRevisions, zalsa::Zalsa, Event,
EventKind, Id, Revision, EventKind, Id, Revision,
}; };
@ -78,7 +78,7 @@ impl<C: Configuration> MemoMap<C> {
/// with an equivalent memo that has no value. If the memo is untracked, BaseInput, /// with an equivalent memo that has no value. If the memo is untracked, BaseInput,
/// or has values assigned as output of another query, this has no effect. /// or has values assigned as output of another query, this has no effect.
pub(super) fn evict(&self, key: Id) { pub(super) fn evict(&self, key: Id) {
use crate::local_state::QueryOrigin; use crate::zalsa_local::QueryOrigin;
use dashmap::mapref::entry::Entry::*; use dashmap::mapref::entry::Entry::*;
if let Occupied(entry) = self.map.entry(key) { if let Occupied(entry) = self.map.entry(key) {

View file

@ -1,7 +1,7 @@
use crossbeam::atomic::AtomicCell; use crossbeam::atomic::AtomicCell;
use crate::{ use crate::{
local_state::{QueryOrigin, QueryRevisions}, zalsa_local::{QueryOrigin, QueryRevisions},
tracked_struct::TrackedStructInDb, tracked_struct::TrackedStructInDb,
AsDynDatabase as _, Database, DatabaseKeyIndex, Id, AsDynDatabase as _, Database, DatabaseKeyIndex, Id,
}; };

View file

@ -4,7 +4,7 @@ use crossbeam::atomic::AtomicCell;
use crate::{ use crate::{
durability::Durability, durability::Durability,
local_state::{QueryOrigin, QueryRevisions}, zalsa_local::{QueryOrigin, QueryRevisions},
Id, Runtime, Id, Runtime,
}; };

View file

@ -4,8 +4,8 @@ use std::{
}; };
use crate::{ use crate::{
hash::FxDashMap, key::DatabaseKeyIndex, local_state::ZalsaLocal, runtime::WaitResult, hash::FxDashMap, key::DatabaseKeyIndex, runtime::WaitResult, zalsa::Zalsa,
zalsa::Zalsa, Database, Id, zalsa_local::ZalsaLocal, Database, Id,
}; };
#[derive(Default)] #[derive(Default)]

View file

@ -4,7 +4,7 @@ use std::{
}; };
use crate::{ use crate::{
cycle::CycleRecoveryStrategy, local_state::QueryOrigin, zalsa::IngredientIndex, Database, cycle::CycleRecoveryStrategy, zalsa_local::QueryOrigin, zalsa::IngredientIndex, Database,
DatabaseKeyIndex, Id, DatabaseKeyIndex, Id,
}; };

View file

@ -17,7 +17,7 @@ use crate::{
id::{AsId, FromId}, id::{AsId, FromId},
ingredient::{fmt_index, Ingredient}, ingredient::{fmt_index, Ingredient},
key::{DatabaseKeyIndex, DependencyIndex}, key::{DatabaseKeyIndex, DependencyIndex},
local_state::QueryOrigin, zalsa_local::QueryOrigin,
plumbing::{Jar, Stamp}, plumbing::{Jar, Stamp},
zalsa::IngredientIndex, zalsa::IngredientIndex,
Database, Durability, Id, Revision, Database, Durability, Id, Revision,

View file

@ -1,7 +1,7 @@
use crate::cycle::CycleRecoveryStrategy; use crate::cycle::CycleRecoveryStrategy;
use crate::ingredient::{fmt_index, Ingredient}; use crate::ingredient::{fmt_index, Ingredient};
use crate::input::Configuration; use crate::input::Configuration;
use crate::local_state::QueryOrigin; use crate::zalsa_local::QueryOrigin;
use crate::zalsa::IngredientIndex; use crate::zalsa::IngredientIndex;
use crate::{Database, DatabaseKeyIndex, Id, Revision}; use crate::{Database, DatabaseKeyIndex, Id, Revision};
use std::fmt; use std::fmt;

View file

@ -9,7 +9,7 @@ use crate::durability::Durability;
use crate::id::AsId; use crate::id::AsId;
use crate::ingredient::fmt_index; use crate::ingredient::fmt_index;
use crate::key::DependencyIndex; use crate::key::DependencyIndex;
use crate::local_state::QueryOrigin; use crate::zalsa_local::QueryOrigin;
use crate::plumbing::Jar; use crate::plumbing::Jar;
use crate::zalsa::IngredientIndex; use crate::zalsa::IngredientIndex;
use crate::{Database, DatabaseKeyIndex, Id}; use crate::{Database, DatabaseKeyIndex, Id};

View file

@ -16,7 +16,7 @@ mod ingredient_list;
mod input; mod input;
mod interned; mod interned;
mod key; mod key;
mod local_state; mod zalsa_local;
mod nonce; mod nonce;
mod revision; mod revision;
mod runtime; mod runtime;

View file

@ -9,7 +9,7 @@ use parking_lot::Mutex;
use crate::{ use crate::{
active_query::ActiveQuery, cycle::CycleRecoveryStrategy, durability::Durability, active_query::ActiveQuery, cycle::CycleRecoveryStrategy, durability::Durability,
key::DatabaseKeyIndex, local_state::ZalsaLocal, revision::AtomicRevision, Cancelled, Cycle, key::DatabaseKeyIndex, zalsa_local::ZalsaLocal, revision::AtomicRevision, Cancelled, Cycle,
Database, Event, EventKind, Revision, Database, Event, EventKind, Revision,
}; };

View file

@ -11,7 +11,7 @@ use crate::{
ingredient::{fmt_index, Ingredient, Jar}, ingredient::{fmt_index, Ingredient, Jar},
ingredient_list::IngredientList, ingredient_list::IngredientList,
key::{DatabaseKeyIndex, DependencyIndex}, key::{DatabaseKeyIndex, DependencyIndex},
local_state::QueryOrigin, zalsa_local::QueryOrigin,
salsa_struct::SalsaStructInDb, salsa_struct::SalsaStructInDb,
zalsa::IngredientIndex, zalsa::IngredientIndex,
Database, Durability, Event, Id, Revision, Database, Durability, Event, Id, Revision,

View file

@ -91,7 +91,7 @@ where
field_changed_at > revision field_changed_at > revision
} }
fn origin(&self, _key_index: crate::Id) -> Option<crate::local_state::QueryOrigin> { fn origin(&self, _key_index: crate::Id) -> Option<crate::zalsa_local::QueryOrigin> {
None None
} }

View file

@ -8,10 +8,10 @@ use rustc_hash::FxHashMap;
use crate::cycle::CycleRecoveryStrategy; use crate::cycle::CycleRecoveryStrategy;
use crate::database::UserData; use crate::database::UserData;
use crate::ingredient::{Ingredient, Jar}; use crate::ingredient::{Ingredient, Jar};
use crate::local_state::ZalsaLocal;
use crate::nonce::{Nonce, NonceGenerator}; use crate::nonce::{Nonce, NonceGenerator};
use crate::runtime::{Runtime, WaitResult}; use crate::runtime::{Runtime, WaitResult};
use crate::views::Views; use crate::views::Views;
use crate::zalsa_local::ZalsaLocal;
use crate::{Database, DatabaseImpl, DatabaseKeyIndex, Durability, Revision}; use crate::{Database, DatabaseImpl, DatabaseKeyIndex, Durability, Revision};
pub fn views<Db: ?Sized + Database>(db: &Db) -> &Views { pub fn views<Db: ?Sized + Database>(db: &Db) -> &Views {