Commit graph

29 commits

Author SHA1 Message Date
Ibraheem Ahmed
2a751d559b replace arc-swap with manual AtomicPtr 2025-02-26 09:04:51 -05:00
Chayim Refael Friedman
6134aaf2b5 Introduce Salsa enums
They are of the form:
```
enum Enum {
    Input(Input),
    Interned(Interned),
    ...
}
```
2025-02-25 09:36:36 +01:00
Lukas Wirth
5eb99ccbab Remove some ZalsaDatabase::zalsa calls
Instead pass around `&Zalsa` to callers more to reduce dynamic dispatch, in most of these cases the functions are only called once so the compiler should have enough knowledge to make the extra argument passing virtually free
2025-02-21 08:16:44 +01:00
Robert Balicki
661f6e10ab fix grammar issue in comment 2025-01-27 00:21:10 -05:00
Lukas Wirth
266f620140 Simplify Event construction 2025-01-05 13:00:20 +01:00
Niko Matsakis
acc34396c6
Merge branch 'master' into dhruv/recreate-panic 2024-09-22 07:37:00 -04:00
Micha Reiser
7e8720a2ad
Clippy 2024-09-21 16:36:35 +02:00
Niko Matsakis
2caa5ccf87 return lifetime-extended memo, not value
Change the core operation to be `refresh_memo`.
This is a nice refactoring on its own but it
will also support the refactoring of how
we manage accumulator values.
2024-09-21 06:40:05 -04:00
Micha Reiser
2d55e83845
Remove deleted entries from tracked_struct_ids 2024-09-13 15:19:40 -04:00
Micha Reiser
8175c77cc5
Reduce cloning of sets in ActiveQuery and QueryRevisions 2024-08-22 09:23:21 +02:00
Niko Matsakis
6401563755 store memoized fn results attached to the salsa struct 2024-08-20 10:09:49 -04:00
Niko Matsakis
188f759555 use table for tracked structs and their fields
This also retools a tiny bit how deletion works.
We will reuse ids faster than before, actually.
2024-08-20 10:09:49 -04:00
Niko Matsakis
4d2ccffddc return to the database-wrapping-storage setup 2024-08-04 02:18:54 -04:00
Niko Matsakis
502716d368 pacify the merciless cargo fmt 2024-07-28 21:33:05 +00:00
Niko Matsakis
ab112b7126 rename local_state to zalsa_local 2024-07-28 13:12:58 +00:00
Niko Matsakis
daaa78056a switch to new database design
Under this design, *all* databases are a
`DatabaseImpl<U>`, where the `U` implements
`UserData` (you can use `()` if there is none).

Code would default to `&dyn salsa::Database` but
if you want to give access to the userdata, you
can define a custom database trait
`MyDatabase: salsa::Databse` so long as you

* annotate `MyDatabase` trait definition of
  impls of `MyDatabase` with `#[salsa::db]`
* implement `MyDatabase` for `DatabaseImpl<U>`
  where `U` is your userdata (this could be a
  blanket impl, if you don't know the precise
  userdata type).

The `tests/common/mod.rs` shows the pattern.
2024-07-28 12:47:50 +00:00
Niko Matsakis
64556e9d28 make event generation lazy
Creating events if nobody is listening has
always bugged me.
2024-07-28 12:35:33 +00:00
Niko Matsakis
1842b1dfbb (almost) encansulate Runtime into Zalsa
The distinction is dumb and should go away.
But we still need it for a bit.
2024-07-28 12:35:33 +00:00
Niko Matsakis
596461c213 hide internal methods behind a Zalsa trait
The traits are now quite simple:

* Database is the external trait
* ZalsaDatabase is the internal one, implemented
  by `#[salsa::db]`. It adds two methods,
  `zalsa` and `zalsa_mut`. Those give access
  to our internal methods.

For now I've hidden the methods behind
`&dyn Zalsa`. This is nice and clean but it may
be worth later refactoring to a `struct Zalsa`.
2024-07-28 12:35:33 +00:00
Niko Matsakis
3d2b2d3a65 remove RuntimeId and use ThreadId 2024-07-23 11:53:37 -04:00
Niko Matsakis
59dbfc2826 flatten module hierarchy 2024-07-23 11:52:05 -04:00
David Barsky
86f06d8485 chore: use tracing instead of log 2024-07-22 18:02:40 -04:00
Niko Matsakis
dde7341f97 create macro-rules macros to encapsulate output
This is a new idea for how to manage procedural
macros, which I kind of hate.
2024-07-13 05:45:22 -04:00
Niko Matsakis
73b8134345 WIP checkpoint 2024-07-12 07:51:28 -04:00
Niko Matsakis
15106ff8ea reorganize plumbing 2024-07-12 07:11:31 -04:00
Niko Matsakis
c84bd1b5c2 WIP new approach with upcasts 2024-07-10 08:13:00 -04:00
Niko Matsakis
fe1b06a48a WIP-- checkpoint, dynamic jars 2024-07-08 06:25:32 -04:00
Niko Matsakis
e1920bdda6 require databases and ingredients to be static 2024-07-06 08:15:27 -04:00
Matthijs Brobbel
c7851112a5
Rename salsa-2022 to salsa 2024-06-18 09:40:21 +02:00
Renamed from components/salsa-2022/src/function/execute.rs (Browse further)