aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/internal_prelude.rs
Commit message (Collapse)AuthorAgeFilesLines
* Use "extend" for tor-memquota ArcMemoryQuotaTrackerExtIan Jackson2026-07-161-0/+1
|
* memquota: Extract HasMemoryCost and derive to new crate.Nick Mathewson2026-02-021-1/+2
| | | | This will help resolve some dependencies in our graph.
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* Migrate to waker noopdisha2025-09-221-1/+3
|
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-071-5/+5
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* tor-memquota: config now supports `ExplicitOrAuto`Steven Engler2025-07-311-1/+1
| | | | | Note that this contains a breaking change to the `ConfigBuilder`. This should not break any existing toml configuration files.
* Merge branch 'mq-fix' into 'main'Ian Jackson2024-10-221-1/+1
|\ | | | | | | | | memquota: Fix account lifetime bugs, and arrange to test mq in shadow See merge request tpo/core/arti!2560
| * memquota: Log a trace message when a claim failsIan Jackson2024-10-211-1/+1
| |
* | Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-1/+1
|/
* Merge branch 'mq-prevent' into 'main'Ian Jackson2024-10-151-0/+1
|\ | | | | | | | | | | | | Use clippy to prevent non-mq use of mpsc::channel Closes #1659 See merge request tpo/core/arti!2536
| * Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-151-0/+1
| | | | | | | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* | memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-1/+1
|/ | | | Fixes a TODO.
* Abolish SIZE in favour of std::mem::size_ofIan Jackson2024-10-021-2/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086837
* tor-memquota: Provide facilities for deriving HasMemoryCostIan Jackson2024-10-021-0/+3
|
* tor-memquota: Implement SinkTrySend for mq_queue::SenderIan Jackson2024-10-011-1/+1
| | | | Plumbing.
* tor-memquota: Erase the CoarseTimeProvider from mq_queue::SenderIan Jackson2024-09-261-1/+2
| | | | | | | | | | Use tor_rtcompat::DynTimeProvider instead. Ultimately, we're going to want one of these in Channel etc. The CoarseTimeProvider generic argument then becomes pervasive. Instead, erase it. This will involve an indirect function call each time an item is inserted. I think that can't be helped.
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-251-1/+0
| | | | | | The `derive_more` crate broke backward compatibility with this version, so this change involved quite a few manual fixups. With luck, they'll keep compatibility for some while in the future.
* tor-memquota: Provide reconfigure methodIan Jackson2024-09-041-1/+1
|
* tor-memquota: Make reclamation wakeup no longer throw internal errorsIan Jackson2024-09-041-1/+1
| | | | I realised a way this could happen without there being a bug.
* tor-memquota: Rework optionality configurationIan Jackson2024-09-041-2/+1
| | | | | | | | | | | | | | | | | | Allow a `Config` to represent "this is supposed to be disabled". This involves wrapping the actual built configuration in an IfEnabled. We treat max = usize::MAX, or max being unspecified, as "disable". We can now reporting an error during config building if max is set but we're compiling the feature out. Conversely, we can now make `MemoryQuotaTracker::new()` unconditional, since enabled confiogurations are uninhabited when the feature is compiled out. We change how we derive the setters, deriving them from the Builder. I chose to abolish the use of derive_builder. See the new comment on ConfigBuilder.
* Move stream_peek into tor-async-utilsJim Newsome2024-08-291-1/+3
|
* Remove NoopWaker; use futures::task::noop_waker_ref insteadJim Newsome2024-08-271-2/+2
|
* byte_qty: Move to tor-basic-utilsIan Jackson2024-08-271-3/+3
| | | | Code motion of byte_qty.rs, and minimal necessary supporting changes.
* byte_qty: Rename Qty to ByteQty and make it pubIan Jackson2024-08-271-1/+1
| | | | | | | We're going to make this into a proper public type. It's going to move into a different crate, where there's no prelude, so give it a bespoke set of imports too.
* byte_qty: Move Qty into its own module, byte_qty.Ian Jackson2024-08-271-1/+2
| | | | | | | Code motion, part 1. Also explain in comments at the top of the new module why we are doing this at all rather than using an existing thing.
* tor-memquota: Introduce IfEnabled and EnabledTokenIan Jackson2024-08-191-0/+1
| | | | EnabledToken is pub because it's going to appear in public APIs.
* tor-memquota: mq_queue: Provide `new` constructors for SpecsIan Jackson2024-08-151-1/+1
| | | | | Discussed here https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059928
* tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queueIan Jackson2024-08-151-3/+5
|
* tor-memquota: Add a Sealed traitIan Jackson2024-08-151-0/+1
| | | | We'll use this in a moment.
* tor-memquota: Provide StreamUnobtrusivePeekerIan Jackson2024-07-241-2/+4
| | | | | | I'm not particularly pleased with this name. We need names for both the type, and the trait we'll almost certainly want to introduce in the future.
* tor-memquota: memory_cost: New trait and typed wrappersIan Jackson2024-07-241-0/+1
|
* Rename tor-memtrack to tor-memquotaIan Jackson2024-04-291-0/+63