summaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src/lib.rs
Commit message (Collapse)AuthorAgeFilesLines
* memquota: Change ToplevelAccount to be an alias for Arc<MemoryQuotaTracker>Ian Jackson2024-10-151-0/+1
| | | | Fixes a TODO.
* memquota: Further docs tweaksIan Jackson2024-10-091-2/+3
|
* mq docs: Add some cross-references from tor-memquota to tor-protoIan Jackson2024-10-071-0/+3
| | | | 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: Uncomment docs about mq_queue, and remove the TODOIan Jackson2024-10-071-4/+4
|
* Merge branch 'mcost' into 'main'Ian Jackson2024-10-021-1/+7
|\ | | | | | | | | Implement tor_memquota:HasMemory cost for a lot of types See merge request tpo/core/arti!2459
| * 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-021-1/+1
| | | | | | | | | | As per https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/2459#note_3086841
| * 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-021-0/+6
| |
* | memquota: Note a TODO about overheadsIan Jackson2024-10-021-0/+5
|/
* tor-memquota: queue plan: Add a cross-referenceIan Jackson2024-09-101-0/+3
|
* 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-101-0/+9
| | | | | | 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: 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.
* tor-memquota: Unstable cargo feature for exposing info for testingIan Jackson2024-09-041-0/+7
|
* Fix typosDimitris Apostolou2024-09-031-1/+1
|
* Move stream_peek into tor-async-utilsJim Newsome2024-08-291-2/+0
|
* byte_qty: Move to tor-basic-utilsIan Jackson2024-08-271-1/+0
| | | | Code motion of byte_qty.rs, and minimal necessary supporting changes.
* byte_qty: Move Qty into its own module, byte_qty.Ian Jackson2024-08-271-0/+1
| | | | | | | 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: Move the macro-containing modules earlier in the lib.rsIan Jackson2024-08-271-2/+3
| | | | | | This makes more sense than having them alphabetical. Noticed while I was working on moving other code.
* Merge branch 'peekable-poll-set' into 'main'Jim Newsome2024-08-211-1/+2
|\ | | | | | | | | Add and use `PeekableStream` and `UnobtrusivePeekableStream` See merge request tpo/core/arti!2345
| * Expose stream_peekJim Newsome2024-08-211-1/+2
| |
* | tor-memquota: Pass EnabledToken to IsParticipant methodsIan Jackson2024-08-191-0/+1
| | | | | | | | | | | | | | 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/+0
| |
* | tor-memquota: Allow memory tracking to be compiled outIan Jackson2024-08-191-0/+2
| | | | | | | | | | | | | | 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-2/+0
| | | | | | | | | | | | | | | | | | | | 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 IfEnabled and EnabledTokenIan Jackson2024-08-191-0/+3
|/ | | | EnabledToken is pub because it's going to appear in public APIs.
* tor-memquota: Add mq_queue, memory-quota-tracking (MPSC) queueIan Jackson2024-08-151-0/+1
|
* tor-memquota: Add a Sealed traitIan Jackson2024-08-151-0/+6
| | | | We'll use this in a moment.
* tor-memquota: Provide StreamUnobtrusivePeekerIan Jackson2024-07-241-0/+1
| | | | | | 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.
* Merge branch 'memquota-typed' into 'main'Ian Jackson2024-07-241-1/+7
|\ | | | | | | | | tor-memquota: HasMemoryCost trait, and type-safe methods See merge request tpo/core/arti!2282
| * tor-memquota: memory_cost: New trait and typed wrappersIan Jackson2024-07-241-0/+2
| |
| * tor-memquota: Add get_used_approx accessorIan Jackson2024-07-241-1/+5
| | | | | | | | | | I just want this for a test right now, bui it seems like it would be good to expose it publicly.
* | tor-memquota: Tidy up a minor formatting glitch in a doc commentIan Jackson2024-07-241-1/+1
|/
* Re-run maint/add_warning.Nick Mathewson2024-05-061-2/+2
| | | | This commit is automatically generated.
* Rename tor-memtrack to tor-memquotaIan Jackson2024-04-291-0/+206