summaryrefslogtreecommitdiff
path: root/crates/tor-memquota/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/tor-memquota/src')
-rw-r--r--crates/tor-memquota/src/error.rs2
-rw-r--r--crates/tor-memquota/src/lib.rs2
-rw-r--r--crates/tor-memquota/src/mtracker.rs16
-rw-r--r--crates/tor-memquota/src/mtracker/reclaim.rs6
-rw-r--r--crates/tor-memquota/src/mtracker/reclaim/deferred_drop.rs2
-rw-r--r--crates/tor-memquota/src/utils.rs2
6 files changed, 15 insertions, 15 deletions
diff --git a/crates/tor-memquota/src/error.rs b/crates/tor-memquota/src/error.rs
index 8a546f730..567d26a03 100644
--- a/crates/tor-memquota/src/error.rs
+++ b/crates/tor-memquota/src/error.rs
@@ -52,7 +52,7 @@ enum ReclaimedErrorInner {
#[default]
Collapsed,
- /// Othere error from tracker
+ /// Other error from tracker
#[error("{0}")]
TrackerError(#[from] Error),
}
diff --git a/crates/tor-memquota/src/lib.rs b/crates/tor-memquota/src/lib.rs
index b4db0bf6f..822f1b89d 100644
--- a/crates/tor-memquota/src/lib.rs
+++ b/crates/tor-memquota/src/lib.rs
@@ -2,7 +2,7 @@
#![doc = include_str!("../README.md")]
#![cfg_attr(not(feature = "memquota"), allow(unused))]
-//! ## Intended behavour
+//! ## Intended behaviour
//!
//! In normal operation we try to track as little state as possible, cheaply.
//! We do track total memory use in nominal bytes
diff --git a/crates/tor-memquota/src/mtracker.rs b/crates/tor-memquota/src/mtracker.rs
index 75d0c3548..75dd5c11a 100644
--- a/crates/tor-memquota/src/mtracker.rs
+++ b/crates/tor-memquota/src/mtracker.rs
@@ -382,13 +382,13 @@ struct State {
struct Global {
/// Total memory used
///
- /// Wrapper type for ensuring we wake up the reclaimation task
+ /// Wrapper type for ensuring we wake up the reclamation task
total_used: TotalQtyNotifier,
/// Configuration
config: Config,
- /// Make this type uninhbaited if memory tracking is compiled out
+ /// Make this type uninhabited if memory tracking is compiled out
#[allow(dead_code)]
enabled: EnabledToken,
}
@@ -426,7 +426,7 @@ struct PRecord {
/// The hooks provided by the Participant
particip: drop_reentrancy::ProtectedWeak<dyn IsParticipant>,
- /// Make this type uninhbaited if memory tracking is compiled out
+ /// Make this type uninhabited if memory tracking is compiled out
#[allow(dead_code)]
enabled: EnabledToken,
}
@@ -585,7 +585,7 @@ impl MemoryQuotaTracker {
// Circular parent relationships might need just a little care
// in the reclamation loop (to avoid infinitely looping),
// but aren't inherently unsupportable.
- #[allow(clippy::redundant_closure_call)] // We have IEFEs for good reaons
+ #[allow(clippy::redundant_closure_call)] // We have IEFEs for good reasons
pub fn new_account(self: &Arc<Self>, parent: Option<&Account>) -> crate::Result<Account> {
let Enabled(mut state, enabled) = self.lock()? else {
return Ok(Account(Noop));
@@ -787,7 +787,7 @@ impl Account {
use std::sync::atomic::{AtomicBool, Ordering};
- /// Temporary participant, which stands in during constructon
+ /// Temporary participant, which stands in during construction
#[derive(Debug)]
struct TemporaryParticipant {
/// The age, which is right now. We hope this is all fast!
@@ -815,7 +815,7 @@ impl Account {
let partn_ = partn
.0
.as_enabled()
- .ok_or_else(|| internal!("Enabled Acccount gave Noop Participant"))?;
+ .ok_or_else(|| internal!("Enabled Account gave Noop Participant"))?;
let aid = partn_.aid;
let pid_weak = *partn_.pid;
@@ -1110,7 +1110,7 @@ impl Participation {
/// Destroy this participant
///
/// Treat as freed all the memory allocated via this `Participation` and its clones.
- /// After this, other clones of this `Participation` are no longer useable:
+ /// After this, other clones of this `Participation` are no longer usable:
/// attempts to do so will give errors.
/// (although they can still be used to get at the `Account`, if it still exists).
///
@@ -1245,7 +1245,7 @@ impl State {
/// The returned `HashSet` includes `parent_aid`, its children,
/// their children, and so on.
///
- /// Used in the reclaimation algorithm in [`reclaim`].
+ /// Used in the reclamation algorithm in [`reclaim`].
fn get_aid_and_children_recursively(&self, parent_aid: AId) -> HashSet<AId> {
let mut out = HashSet::<AId>::new();
let mut queue: Vec<AId> = vec![parent_aid];
diff --git a/crates/tor-memquota/src/mtracker/reclaim.rs b/crates/tor-memquota/src/mtracker/reclaim.rs
index 12532a0e2..005b7d832 100644
--- a/crates/tor-memquota/src/mtracker/reclaim.rs
+++ b/crates/tor-memquota/src/mtracker/reclaim.rs
@@ -15,7 +15,7 @@ use deferred_drop::{DeferredDrop, GuardWithDeferredDrop};
/// On 64-bit systems, bigger than the refcounts, which are all `u32`
type NumParticips = usize;
-//========== candiate victim analysis ==========
+//========== candidate victim analysis ==========
/// The nominal data age of a participant
#[derive(Ord, PartialOrd, Eq, PartialEq)]
@@ -109,14 +109,14 @@ fn analyse_particip(precord: &PRecord, defer_drop: &mut DeferredDrop) -> PStatus
PStatus::NoData
}
-//========== reclamation algorith, the main pieces ==========
+//========== reclamation algorithm, the main pieces ==========
/// State while reclamation is active
struct Reclaiming {
/// The heap of candidates, oldest at top of heap
heap: BinaryHeap<Reverse<(Age, AId)>>,
- /// Make this type uninhbaited if memory tracking is compiled out
+ /// Make this type uninhabited if memory tracking is compiled out
enabled: EnabledToken,
}
diff --git a/crates/tor-memquota/src/mtracker/reclaim/deferred_drop.rs b/crates/tor-memquota/src/mtracker/reclaim/deferred_drop.rs
index 3b0742a82..02bd6611e 100644
--- a/crates/tor-memquota/src/mtracker/reclaim/deferred_drop.rs
+++ b/crates/tor-memquota/src/mtracker/reclaim/deferred_drop.rs
@@ -16,7 +16,7 @@
use super::*;
-/// `MutexGuard<State>` but also a list of `Arc<dyn Partcipant>` to drop when we unlock
+/// `MutexGuard<State>` but also a list of `Arc<dyn Participant>` to drop when we unlock
#[derive(Debug, Default)]
pub(super) struct GuardWithDeferredDrop<'m> {
/// The mutex guard
diff --git a/crates/tor-memquota/src/utils.rs b/crates/tor-memquota/src/utils.rs
index 1bede7b09..fa2de3965 100644
--- a/crates/tor-memquota/src/utils.rs
+++ b/crates/tor-memquota/src/utils.rs
@@ -1,4 +1,4 @@
-//! Miscellanous internal utilities
+//! Miscellaneous internal utilities
use crate::internal_prelude::*;