aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src
Commit message (Collapse)AuthorAgeFilesLines
...
| * memquota: Log a trace message when a claim failsIan Jackson2024-10-212-1/+9
| |
| * memquota: Log a message at info on startup, if enabledIan Jackson2024-10-211-0/+3
| |
* | Merge branch 'bug1531' into 'main'Ian Jackson2024-10-215-16/+16
|\ \ | |/ |/| | | | | | | | | Move crates to crates to slotmap-careful Closes #1531 See merge request tpo/core/arti!2530
| * Convert a few crates to slotmap-carefulNeel Chauhan2024-10-175-16/+16
| |
* | memquota: suppress clippy::single_match warning.Nick Mathewson2024-10-171-0/+1
|/ | | | | "Suppress" rather than "fix": this pattern is intentional, and makes it clear that we're doing an exhaustive match.
* Merge branch 'mq-prevent' into 'main'Ian Jackson2024-10-153-2/+4
|\ | | | | | | | | | | | | 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 wanted (fmt)Ian Jackson2024-10-151-1/+2
| |
| * Introduce mpsc_channel_no_memquota and use it in the places it's wantedIan Jackson2024-10-153-2/+3
| | | | | | | | | | 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-152-1/+2
| | | | | | | | Fixes a TODO.
* | memquota: Provide a method Arc::<MemoryQuotaTracker>::new_noop()Ian Jackson2024-10-151-1/+15
|/ | | | | | | We'll need this to allow `ToplevelAccount::new_noop` (eg, in tests) when the type of ToplevelAccount changes. We have to do this via an extension trait.
* Merge branch 'mq-doc' into 'main'Ian Jackson2024-10-093-28/+13
|\ | | | | | | | | | | | | memquota architecture documentation Closes #1660 See merge request tpo/core/arti!2509
| * memquota: Further docs tweaksIan Jackson2024-10-091-2/+3
| |
| * mq docs: Add some cross-references from tor-memquota to tor-protoIan Jackson2024-10-072-0/+8
| | | | | | | | These can't be rustdoc links because they point up the crate hierarchy.
| * mq docs: Add a linkIan Jackson2024-10-071-1/+1
| |
| * mq docs: Move arti queues text to tor_proto::memquotaIan Jackson2024-10-071-24/+0
| |
| * mq docs: Uncomment docs about mq_queue, and remove the TODOIan Jackson2024-10-071-4/+4
| |
* | tor-memquota: miri: disable tests that use coarsetimeIan Jackson2024-10-083-3/+9
|/
* Merge branch 'mcost' into 'main'Ian Jackson2024-10-024-4/+372
|\ | | | | | | | | Implement tor_memquota:HasMemory cost for a lot of types See merge request tpo/core/arti!2459
| * tor-memquota: Fix more hard tabs.Ian Jackson2024-10-021-2/+2
| |
| * tor-memquota: Replace MemoryCostStructuralCopy with assert_copy_static (fmt)Ian Jackson2024-10-021-1/+1
| |
| * tor-memquota: Replace MemoryCostStructuralCopy with assert_copy_staticIan Jackson2024-10-022-23/+13
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086841
| * tor-memquota: Move and reword a commentIan Jackson2024-10-021-3/+5
| | | | | | | | | | | | This comment is more applicable to the memory_cost_structural_copyx macro than the wrapper type, especially since the wrapper type is going away.
| * tor-memquota: Add an example for HasMemoryCost deriveIan Jackson2024-10-021-0/+39
| |
| * Abolish SIZE in favour of std::mem::size_ofIan Jackson2024-10-022-22/+10
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086837
| * tor-memquota: Provide explicit "indirect size" feature in deriveIan Jackson2024-10-021-0/+6
| |
| * Use std::num::NonZeroFooIan Jackson2024-10-021-4/+5
| | | | | | | | | | | | | | Not the generic version which isn't supported in our MSRV. We may want to revert this in the future, so let's make it a separate commit.
| * tor-memquota: Export Account at the toplevelIan Jackson2024-10-021-1/+1
| | | | | | | | | | It turns out we're mostly going to want to deal in Accounts, not Arc<MemoryQuotaaTracker>s.
| * tor-memquota: Provide facilities for deriving HasMemoryCostIan Jackson2024-10-023-0/+342
| |
| * tor-memquota: Make EnabledToken constructors constIan Jackson2024-10-021-2/+2
| | | | | | | | This will be convenient in some tests etc.
* | Merge branch 'misc' into 'main'Ian Jackson2024-10-021-0/+5
|\ \ | |/ |/| | | | | tor-proto: SometimesUnboundedSink: provide as_inner accessor See merge request tpo/core/arti!2483
| * memquota: Note a TODO about overheadsIan Jackson2024-10-021-0/+5
| |
* | Merge branch 'close-channel-2' into 'main'Nick Mathewson2024-10-021-1/+12
|\ \ | | | | | | | | | | | | Provide and implement SinkCloseChannel See merge request tpo/core/arti!2485
| * | tor-memquota: Implement SinkChannelClose for mq_queueIan Jackson2024-10-011-1/+12
| |/
* | tor-memquota: Test error handling paths in try_send implIan Jackson2024-10-021-0/+54
| |
* | tor-memquota: Prepare for SinkTrySend testsIan Jackson2024-10-021-3/+24
| | | | | | | | | | | | Implement SinkTrySend for BustedSink. Implement SinkTrySendError for BustedError. Add an is_disconnected field (so we can test different error paths).
* | tor-memquota: Make BustedSink contain the BustedError to yield (fmt)Ian Jackson2024-10-021-1/+3
| |
* | tor-memquota: Make BustedSink contain the BustedError to yieldIan Jackson2024-10-021-8/+14
|/ | | | This will let us test different errors.
* tor-memquota: Implement SinkTrySend for mq_queue::SenderIan Jackson2024-10-012-1/+32
| | | | Plumbing.
* tor-memquota: Provide TypedParticipation::try_claim_or_returnIan Jackson2024-10-011-1/+24
| | | | We're going to want this for try_send.
* Merge branch 'dyn-time' into 'main'Ian Jackson2024-10-012-14/+35
|\ | | | | | | | | Provide a type-erased SleepProvider + CoarseTimeProvider and use it for memquota queues See merge request tpo/core/arti!2460
| * tor-memquota: mq_queue: Provide Sender::time_provider accessorIan Jackson2024-09-261-0/+14
| | | | | | | | Nothing uses this yet, but we will do so.
| * tor-memquota: Erase the CoarseTimeProvider from mq_queue::Sender (fmt)Ian Jackson2024-09-261-1/+6
| |
| * tor-memquota: Erase the CoarseTimeProvider from mq_queue::SenderIan Jackson2024-09-262-14/+16
| | | | | | | | | | | | | | | | | | | | 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.
| * tor-memquota: mq_queue: Take Account by referenceIan Jackson2024-09-261-5/+5
| | | | | | | | | | | | It doesn't need an owned value here. (clippy's note about this was defeated by this being a trait method.)
* | Merge branch 'misc' into 'main'Ian Jackson2024-10-012-0/+38
|\ \ | |/ |/| | | | | Miscellaneous cleanups, mostly in tor-memquota See merge request tpo/core/arti!2461
| * tor-memquota: Clarify that mq isn't the accountholderIan Jackson2024-09-261-0/+4
| |
| * tor-memquota: Provide Account::new_childIan Jackson2024-09-261-0/+15
| |
| * tor-memquota: provide Account::new_noopIan Jackson2024-09-261-0/+7
| | | | | | | | This will be useful in tests.
| * tor-memquota: impl FusedStream for Receiver, where appropriateIan Jackson2024-09-261-0/+12
| |
* | Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-254-6/+5
|/ | | | | | 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.