Skip to content

Commit

Permalink
Auto merge of rust-lang#2427 - Nilstrieb:doc-fix, r=saethlin
Browse files Browse the repository at this point in the history
Fix outdated docs in sb stack cache

Since `Item` is bitpacked now, the full `Item` is stored in the cache.
  • Loading branch information
bors committed Jul 23, 2022
2 parents b2418e8 + 8b64380 commit 62efc62
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/stacked_borrows/stack.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ pub struct Stack {
unique_range: Range<usize>,
}

/// A very small cache of searches of the borrow stack
/// This maps items to locations in the borrow stack. Any use of this still needs to do a
/// probably-cold random access into the borrow stack to figure out what `Permission` an
/// `SbTag` grants. We could avoid this by also storing the `Permission` in the cache, but
/// most lookups into the cache are immediately followed by access of the full borrow stack anyway.
/// A very small cache of searches of a borrow stack, mapping `Item`s to their position in said stack.
///
/// It may seem like maintaining this cache is a waste for small stacks, but
/// (a) iterating over small fixed-size arrays is super fast, and (b) empirically this helps *a lot*,
Expand Down

0 comments on commit 62efc62

Please sign in to comment.