aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-memquota
Commit message (Collapse)AuthorAgeFilesLines
...
| * tor-memquota: Provide facilities for deriving HasMemoryCostIan Jackson2024-10-024-1/+344
| |
| * 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-013-14/+36
|\ | | | | | | | | 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-263-14/+17
| | | | | | | | | | | | | | | | | | | | 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
| | |
* | | Bump arti- and tor- crates to 0.23.0Nick Mathewson2024-09-301-10/+10
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | Per our policy, every one of these gets a minor bump. Generated with: ``` for crate in $(./maint/list_crates | grep '^\(tor\|arti\)-' ); do cargo set-version --bump minor -p $crate; done ``` (Note the use of `-` at the end end of the grep pattern to prevent matching the `arti` crate.)
* | Merge branch 'msrv-1.77-and-rusqlite-update' into 'main'David Goulet2024-09-261-1/+1
|\ \ | | | | | | | | | | | | Upgrade MSRV to 1.77 , and rusqlite to 0.32.1 See merge request tpo/core/arti!2451
| * | Upgrade MSRV to 1.77Nick Mathewson2024-09-251-1/+1
| |/ | | | | | | This will allow us to upgrade to the latest version of rusqlite.
* / Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-255-7/+6
|/ | | | | | 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.
* Merge branch 'mq-tidy' into 'main'David Goulet2024-09-177-5/+80
|\ | | | | | | | | memquota: be more firm about avoiding panics, and tidy up docs See merge request tpo/core/arti!2404
| * tor-memquota: queue plan: Add a cross-referenceIan Jackson2024-09-101-0/+3
| |
| * tor-memquota: queue plan: Clean up intent and make into a doc commentIan Jackson2024-09-101-32/+24
| | | | | | | | Remove extraneous text, wrap it, and change to a more declarative style.
| * tor-memquota: queue plan: Copy from !1997 discussionIan Jackson2024-09-101-0/+32
| |
| * tor-memquota: Worsify formatting to stop rustfmt making it even worseIan Jackson2024-09-101-1/+3
| |
| * tor-memquota: Use clippy::arithmetic_side_effects, against panicsIan Jackson2024-09-104-0/+12
| | | | | | | | | | | | This detect possibly-panicking operations. Empirically this lint seems rather better now.
| * tor-memquota: Document that we're panic-freeIan Jackson2024-09-101-0/+10
| |
| * tor-memquota: Avoid a perhaps-impossible division-by-zero (fmt)Ian Jackson2024-09-101-1/+5
| |
| * tor-memquota: Avoid a perhaps-impossible division-by-zeroIan Jackson2024-09-101-1/+3
| | | | | | | | | | | | It is not locally obvious that n_particips can't be zero, here. Certainly if it *is* that would be state corruption, but I don't think I can quite rule it out in the presence of a bug somewhere else.
| * tor-memquota: Use a const to hoist a panic to compile-timeIan Jackson2024-09-101-1/+3
| |
| * tor-memquota: Use checked_sub .. expect in two places (fmt)Ian Jackson2024-09-101-2/+6
| |
| * tor-memquota: Use checked_sub .. expect in two placesIan Jackson2024-09-101-2/+6
| | | | | | | | | | In these two places, underflow is statically impossible, but demonstrating that to the compiler is probably too onerous.
| * tor-memquota: Move some information into the proper docsIan Jackson2024-09-101-0/+8
| | | | | | | | | | This sentence is very important piece of overall explanation, but didn't make it into the crate level docs.
* | Bump MSRV from 1.70 to 1.75.Wesley Aptekar-Cassels2024-09-161-1/+1
|/
* Fix typo in tor_memquota::ConfigBuilder docIan Jackson2024-09-041-1/+1
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2374#note_3070500
* tor-memquota: Provide reconfigure methodIan Jackson2024-09-042-1/+56
|
* tor-memquota: Break out reclamation wakeupIan Jackson2024-09-041-1/+6
|
* tor-memquota: Make reclamation wakeup no longer throw internal errorsIan Jackson2024-09-042-5/+6
| | | | I realised a way this could happen without there being a bug.
* tor-memquota: Unstable cargo feature for exposing info for testingIan Jackson2024-09-043-3/+26
|
* tor-memquota: Rework optionality configurationIan Jackson2024-09-046-31/+86
| | | | | | | | | | | | | | | | | | 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.
* tor-memquota: impl PartialEq for IfEnabled and EnabledTokenIan Jackson2024-09-041-2/+4
|
* tor-memquota: Add unit tests for config handlingIan Jackson2024-09-042-0/+57
| | | | | We're about to change the config behaviour; adding these tests first allows us to demonstrate the changes.
* Bump all the unstable tor- and arti- crates to 0.22.0.Gabriela Moldovan2024-09-031-10/+10
| | | | | | | | | | Done using: ``` for crate in $(./maint/list_crates | rg '^(tor|arti-)'); do cargo set-version -p $crate 0.22.0 done ```
* Fix formatting issues introduced by fixup-features.Gabriela Moldovan2024-09-031-1/+8
|