summaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/mtracker.rs
Commit message (Collapse)AuthorAgeFilesLines
* tor-memquota: small fmt change to log messageSteven Engler2025-07-311-1/+1
| | | | | | All other INFO log lines emitted when arti starts begin with an uppercase character, so this line looks out of place if it begins with a lowercase character.
* Merge branch 'mq-fix' into 'main'Ian Jackson2024-10-221-0/+24
|\ | | | | | | | | memquota: Fix account lifetime bugs, and arrange to test mq in shadow See merge request tpo/core/arti!2560
| * tor-memquota: Fix rustfmt-damaged indentationIan Jackson2024-10-221-5/+5
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2560#note_3097189
| * memquota: In debug builds, reliably detect use of dropped AccountIan Jackson2024-10-211-0/+13
| | | | | | | | | | This detects the bugs I have just fixed - in Shadow tests with the feature enabled and a (large) limit set.
| * memquota: Log a trace message when a claim failsIan Jackson2024-10-211-0/+8
| |
| * memquota: Log a message at info on startup, if enabledIan Jackson2024-10-211-0/+3
| |
* | Convert a few crates to slotmap-carefulNeel Chauhan2024-10-171-1/+1
|/
* 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-151-1/+1
| | | | | These are the call sites where using this fucntion is correct. (Outside tor-rtmock, which we'll do separately.)
* Merge branch 'mq-doc' into 'main'Ian Jackson2024-10-091-0/+5
|\ | | | | | | | | | | | | memquota architecture documentation Closes #1660 See merge request tpo/core/arti!2509
| * mq docs: Add some cross-references from tor-memquota to tor-protoIan Jackson2024-10-071-0/+5
| | | | | | | | These can't be rustdoc links because they point up the crate hierarchy.
* | tor-memquota: miri: disable tests that use coarsetimeIan Jackson2024-10-081-1/+3
|/
* 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: 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: Provide reconfigure methodIan Jackson2024-09-041-0/+55
|
* tor-memquota: Rework optionality configurationIan Jackson2024-09-041-4/+5
| | | | | | | | | | | | | | | | | | 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-031-8/+8
|
* tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-191-6/+7
| | | | | | | 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-1/+16
|
* tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-191-2/+11
| | | | | | | Now if we run doctests without the feature enabled, we test that a no-op MemoryQuotaTracker works. Those tests aren't currently run in CI, but they will be after !2350.
* tor-memquota: Support a no-op MemoryQuotaTrackerIan Jackson2024-08-191-41/+157
| | | | | | | | | | 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: Introduce self_ variables in mtracker.rs (fmt)Ian Jackson2024-08-191-1/+4
|
* tor-memquota: Introduce self_ variables in mtracker.rsIan Jackson2024-08-191-48/+69
| | | | | | | | We're going to bind self_ to something more complicated, in each of these functions, and that's what all these field references etc. will need to refer to. Do this mechanical change first for clarity.
* tor-memquota: find_in_tracker: Allow internal use of non-unit errorsIan Jackson2024-08-191-6/+6
|
* tor-memquota: pre-apply rustfmt churnIan Jackson2024-08-191-1/+4
| | | | This will make some later diffs easier to read.
* tor-memquota: Fix typosIan Jackson2024-08-151-2/+2
|
* tor-memquota: Provide Participation::new_dangling and WeakAccount::new_danglingIan Jackson2024-08-151-0/+26
| | | | | We're going to want the one for Participation - it saves us an annoying Option. Let's provide the one for WeakAccount too.
* Merge branch 'memquota-typed' into 'main'Ian Jackson2024-07-241-9/+19
|\ | | | | | | | | 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-1/+1
| |
| * tor-memquota: Improve register_participant_withIan Jackson2024-07-241-8/+8
| | | | | | | | | | Now the constructor is able to return other data to the caller, passing it through the mtracker machinery.
| * tor-memquota: Add get_used_approx accessorIan Jackson2024-07-241-0/+10
| | | | | | | | | | I just want this for a test right now, bui it seems like it would be good to expose it publicly.
* | tor-memquota: destroy_participant: Clarify "no longer useable"Ian Jackson2024-07-241-1/+2
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2281#note_3051105
* | tor-memquota: Provide Participant::destroy_participantIan Jackson2024-07-241-0/+28
|/ | | | The stream wrapper is going to want this.
* Rename tor-memtrack to tor-memquotaIan Jackson2024-04-291-0/+1047