Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ibraheemdev committed Feb 12, 2022
1 parent 10667b6 commit e8c71a4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
//! # A note on `Guard` and memory use
//!
//! You may have noticed that many of the access methods on this map take a reference to an
//! [`epoch::Guard`]. The exact details of this are beyond the scope of this documentation (for
//! [`Guard`]. The exact details of this are beyond the scope of this documentation (for
//! that, see [`crossbeam::epoch`]), but some of the implications bear repeating here. You obtain a
//! `Guard` using [`epoch::pin`], and you can use references to the same guard to make multiple API
//! `Guard` using [`HashMap::guard`], and you can use references to the same guard to make multiple API
//! calls if you wish. Whenever you get a reference to something stored in the map, that reference
//! is tied to the lifetime of the `Guard` that you provided. This is because each `Guard` prevents
//! the destruction of any item associated with it. Whenever something is read under a `Guard`,
Expand Down
9 changes: 4 additions & 5 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,8 +76,8 @@ macro_rules! load_factor {
/// A concurrent hash table.
///
/// Flurry uses [`Guards`] to control the lifetime of the resources that get stored and
/// extracted from the map. [`Guards`] are acquired through the [`epoch::pin`], [`HashMap::pin`]
/// and [`HashMap::guard`] functions. For more information, see the [notes in the crate-level
/// extracted from the map. [`Guards`] are acquired through the [`HashMap::pin`] and
/// [`HashMap::guard`] functions. For more information, see the [notes in the crate-level
/// documentation].
///
/// [notes in the crate-level documentation]: index.html#a-note-on-guard-and-memory-use
Expand Down Expand Up @@ -329,15 +329,14 @@ impl<K, V, S> HashMap<K, V, S> {
map
}

/// Associate a custom [`epoch::Collector`] with this map.
/// Associate a custom [`seize::Collector`] with this map.
///
/// By default, the global collector is used. With this method you can use a different
/// collector instead. This may be desireable if you want more control over when and how memory
/// reclamation happens.
///
/// Note that _all_ `Guard` references provided to access the returned map _must_ be
/// constructed using guards produced by `collector`. You can use [`HashMap::register`] to get
/// a thread-local handle to the collector that then lets you construct an [`epoch::Guard`].
/// constructed using guards produced by `collector`.
pub fn with_collector(mut self, collector: Collector) -> Self {
self.collector = collector;
self
Expand Down

0 comments on commit e8c71a4

Please sign in to comment.