aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src
Commit message (Collapse)AuthorAgeFilesLines
* Use "extend" for tor-memquota ArcMemoryQuotaTrackerExtIan Jackson2026-07-162-4/+3
|
* add_warning: add reference to arti#2556Jim Newsome2026-07-151-1/+1
|
* Removed unnecessary lintpryty262026-07-151-1/+1
| | | | Removed unnecessary lint
* maint: Run maint/add_warning to deny string slicesClara Engler2026-06-099-0/+9
| | | | | | | | | | | | This commit executes maint/add_warning with the just added change to deny string slices except in tests. I recommend auditing this by checking out the previous commit followed by running the script yourself and then verifying that the diff is identical to this commit. This commit makes cargo clippy fail. We will add exceptions in the next commit.
* config: Add a method to fill in a builder with unset defaultsNick Mathewson2026-05-271-0/+16
| | | | | | | | | | | | | | | This new method modifies a builder by replacing any unset values that have a default with that default. We're using this method so that we can re-serialize a builder into a `ConfigurationTree` with all of its default values included. In all cases, `b.apply_defaults()?; b.build()` should produce the same output as `b.build()`. The interesting parts of this commit are in tor_config::load and tor_config::derive. The rest of this commit just adds `apply_defaults` to other builders that _aren't_ made with `derive_deftly(TorConfig)`.
* Upgrade rand crates to 0.10.Wesley Aptekar-Cassels2026-05-121-1/+1
| | | | | | | | | | | When the circ-padding feature is enabled, we use maybenot, which does not yet support rand 0.10. In the meantime, enabling this feature pulls in rand 0.9. This is not ideal, but should be okay as a temporary situation. This also replaces the use of ReseedingRng (which was removed in 0.10) with the reseeding_rng crate. This is somewhat less performant, but it should be okay.
* memquota: Say what kind of errors add_parent() returnsGabriela Moldovan2026-04-071-2/+2
|
* memquota: Add dedicated variant for duplicate child errorGabriela Moldovan2026-04-073-2/+12
|
* memquota: Expand on the prepare_parent_aid() docsGabriela Moldovan2026-04-071-0/+4
| | | | | Applies the suggestion from https://gitlab.torproject.org/tpo/core/arti/-/merge_requests/3829#note_3388033
* memquota: Adjust Account::add_parent() docsGabriela Moldovan2026-04-071-3/+4
| | | | As suggested by @Diziet
* memquota: Make prepare_parent_aid() error message more genericGabriela Moldovan2026-03-301-2/+1
| | | | This is now used by `Account::add_parent()` too.
* memquota: Add new Account::add_parent() APIGabriela Moldovan2026-03-302-0/+100
|
* memquota: Move parent AId checks to separate function (fmt)Gabriela Moldovan2026-03-301-8/+3
|
* memquota: Move parent AId checks to separate functionGabriela Moldovan2026-03-301-40/+50
| | | | | | I am moving this to another function because we'll soon need to run these same checks in the new `Account::add_parent()` API I'm planning on adding for #2427.
* Fix word duplicate typosTobias Stoeckmann2026-03-152-2/+2
|
* memquota: Implement ExtendBuilder for config builder.Nick Mathewson2026-02-241-0/+13
|
* Allow clippy::collapsible_if to triggerGabriela Moldovan2026-02-161-0/+1
| | | | | | | | | `clippy::collapsible_if` started triggering after bumping the MSRV to 1.88. Since this triggers from a lot of places, and since there even are a couple of instances where we explicitly allow `clippy::collapsible_ifs`, I've opened #2342 for deciding what to do about it.
* memquota: Extract HasMemoryCost and derive to new crate.Nick Mathewson2026-02-025-441/+11
| | | | This will help resolve some dependencies in our graph.
* maint/add_warning: Run script to add new warningGabriela Moldovan2026-01-271-0/+1
| | | | This adds the lint to all our crates.
* tor-memquota: fix builds for 32-bit platformsYaksh Bariya2025-12-091-4/+10
| | | | | Multiplying 8 * GIB overflows the usize limit (4 GIB - 1) on 32-bit platforms. So handle this properly for 32-bit platforms
* Fix name of clippy lint to unchecked_time_subtraction (2)Ian Jackson2025-11-0610-10/+10
| | | | Run maint/add_warning
* all: replace all uses of `futures::task::SpawnExt` with `tor_rtcompat::SpawnExt`Steven Engler2025-11-041-2/+2
|
* Remove "doc_auto_cfg" incantation from all crates.Nick Mathewson2025-09-291-1/+1
| | | | This feature has been removed from nightly, in favor of doc_cfg.
* Migrate to waker noopdisha2025-09-222-2/+4
|
* Fix warnings and errors from edition 2024.Nick Mathewson2025-08-071-3/+2
| | | | | | | | | | The two main causes of errors were: - Since some of the lifetime rules have changed, we no longer need to do as many "bind a variable and immediately return it" patterns, and so clippy now warns about them. - We needed to adjust the explicit captures (`use<...>`) in a couple of our RPIT instances.
* Switch Cargo.toml files to edition 2024.Nick Mathewson2025-08-073-7/+7
| | | | | | | | | | | | | | First, run ``` git grep -l "^edition =" | xargs perl -i -pe 's/^edition *=.*/edition = "2024"/;' ``` Second, manually verify that all Cargo.toml files have changed, and nothing else has changed. Third, run cargo fmt again.
* Fix errors from rustdoc nightly.Nick Mathewson2025-08-051-1/+1
|
* tor-memquota: moved auto calc into separate functionSteven Engler2025-07-311-49/+112
|
* tor-memquota: return an error when `total_available_memory()` failsSteven Engler2025-07-311-15/+29
|
* 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.
* tor-memquota: change behaviour of "auto"Steven Engler2025-07-311-23/+180
| | | | | A `max` of "auto" (the default) now determines a limit based on the system's total available memory, rather than acting as "disabled".
* tor-memquota: config now supports `ExplicitOrAuto`Steven Engler2025-07-312-17/+57
| | | | | Note that this contains a breaking change to the `ConfigBuilder`. This should not break any existing toml configuration files.
* tor-memquota: add config test for `usize::MAX`Steven Engler2025-07-311-0/+4
|
* Merge branch 'nongenericnonzero' into 'main'Ian Jackson2025-07-101-2/+2
|\ | | | | | | | | tor-memquota: Replaced MSRV TODO with explanation as to why it is done this way See merge request tpo/core/arti!3067
| * tor-memquota: Replaced MSRV TODO with explanation as to why it is done this wayhashcatHitman2025-06-241-2/+2
| | | | | | | | | | | | | | | | | | - The TODO regarding replacing usage of qualified names with a generic NonZero<T> has been replaced with a link to an issue requesting clearer documentation for NonZero as to how this cannot be done, due to the perma- unstable type bound on T. Signed-off-by: hashcatHitman <[email protected]>
* | Typo fixes (automatic and hand-verified)Nick Mathewson2025-07-092-2/+2
| | | | | | | | Made with https://crates.io/crates/typos-cli
* | Temporarily suppress mismatched_lifetime_syntaxes.Gabriela Moldovan2025-07-071-0/+1
|/ | | | See #2060.
* Include "bug" in all bug error messagesNick Mathewson2025-04-281-1/+1
|
* tor-memquota: standardized MSRV TODOhashcatHitman2025-04-161-1/+2
| | | | | - Part of a series of commits aimed at replacing all MSRV-related TODOs with a standardized format, which should be easier to find when the MSRV is bumped.
* 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 'mod-module-files' into 'main'Nick Mathewson2025-01-071-0/+1
|\ | | | | | | | | clippy: deny `mod_module_files` See merge request tpo/core/arti!2689
| * clippy: deny `mod_module_files`Steven Engler2025-01-061-0/+1
| | | | | | | | | | | | Denies 'mod.rs' files for consistency. https://rust-lang.github.io/rust-clippy/master/index.html#mod_module_files
* | fix: fix typosDimitris Apostolou2025-01-061-1/+1
|/
* add_warnings, *: Allow clippy::needless_lifetimesNick Mathewson2024-12-031-0/+1
| | | | | | | | In 1.83, this warning triggers on many of our crates. We're thinking of fixing them all, but for now, we're going to disable the warning. This is part of #1765.
* Merge branch 'mq-fix' into 'main'Ian Jackson2024-10-224-4/+28
|\ | | | | | | | | 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: Fix error message stringsIan Jackson2024-10-211-2/+2
| | | | | | | | | | These errors aren't necessarily memory pressure. They can occur due to bugs, and during teardown.
| * 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: Fix a test not to rely on accessing cache with dead AccountIan Jackson2024-10-211-1/+1
| |