summaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/mtracker
Commit message (Collapse)AuthorAgeFilesLines
* squash! Upgrade rand dependency to 0.9.Nick Mathewson2025-03-181-1/+1
| | | | - The Rng::gen() functions have been renamed to Rng::random().
* Upgrade to derive_more 2Nick Mathewson2025-02-261-2/+2
| | | | | This took a little refactoring, since derive_more::Foo no longer re-exports std::ops::Foo.
* 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: Fix a test not to rely on accessing cache with dead AccountIan Jackson2024-10-211-1/+1
| |
* | Convert a few crates to slotmap-carefulNeel Chauhan2024-10-172-4/+4
|/
* Upgrade to derive_more version 1.0.0Nick Mathewson2024-09-252-4/+4
| | | | | | 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: Use clippy::arithmetic_side_effects, against panicsIan Jackson2024-09-101-0/+1
| | | | | | This detect possibly-panicking operations. Empirically this lint seems rather better now.
* 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: Break out reclamation wakeupIan Jackson2024-09-041-1/+6
|
* tor-memquota: Make reclamation wakeup no longer throw internal errorsIan Jackson2024-09-041-4/+5
| | | | I realised a way this could happen without there being a bug.
* tor-memquota: Rework optionality configurationIan Jackson2024-09-041-1/+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.
* Fix typosDimitris Apostolou2024-09-032-4/+4
|
* byte_qty: Move to tor-basic-utilsIan Jackson2024-08-271-1/+1
| | | | Code motion of byte_qty.rs, and minimal necessary supporting changes.
* tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-192-9/+10
| | | | | | | This will hopefully allow much caller code to be compiled out. The users (IsParticipant impls) don't generally need to bother with it - they can just ignore it.
* tor-memquota: Put EnabledToken in various structs, including the reclaimerIan Jackson2024-08-191-2/+10
|
* tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-192-8/+11
| | | | | | | | | | Wrap up most of the structures in IfEnabled. Sadly this diff is very noisy. I experimented with macros for the little enabled check at the start of each function but they didn't really help. We don't test this yet. We'll do a smoke test of this later.
* tor-memquota: pre-apply rustfmt churnIan Jackson2024-08-191-3/+10
| | | | This will make some later diffs easier to read.
* tor-memquota: Rename mby test helper fn to mbytesIan Jackson2024-08-151-16/+16
| | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2292#note_3059520
* tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queueIan Jackson2024-08-151-1/+1
|
* Merge branch 'memquota-typed' into 'main'Ian Jackson2024-07-241-23/+35
|\ | | | | | | | | tor-memquota: HasMemoryCost trait, and type-safe methods See merge request tpo/core/arti!2282
| * tor-memquota: Expose some test utilities for the rest of the crateIan Jackson2024-07-241-4/+7
| |
| * tor-memquota: Improve register_participant_with (fmt)Ian Jackson2024-07-241-18/+24
| |
| * tor-memquota: Improve register_participant_withIan Jackson2024-07-241-5/+8
| | | | | | | | | | Now the constructor is able to return other data to the caller, passing it through the mtracker machinery.
* | tor-memquota: Provide Participant::destroy_participantIan Jackson2024-07-241-0/+29
| | | | | | | | The stream wrapper is going to want this.
* | tor-memquota: Correct a wrong commentIan Jackson2024-07-241-2/+1
|/ | | | | There is no `p_used` here; what we meant was the very same `ClaimedQty.`
* Change deftly syntax to post 0.12.1 versionIan Jackson2024-06-171-1/+1
| | | | | | | | | | | * Change `pub` to `export` * Change the `=` in define to `:` * Change `pub_template_semver_check` to `template_export_semver_check` Right now, 0.12.1 supports both syntaxes. I have verified this branch also compiles with https://gitlab.torproject.org/Diziet/rust-derive-deftly/-/merge_requests/402 ee171ffaf56d7dcb7d75584054921153fe19b222
* Rename tor-memtrack to tor-memquotaIan Jackson2024-04-295-0/+1533