This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +6
-4
lines changed
src/tools/miri/src/borrow_tracker Expand file tree Collapse file tree 2 files changed +6
-4
lines changed Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ pub struct GlobalStateInner {
9696 /// Next unused call ID (for protectors).
9797 next_call_id : CallId ,
9898 /// All currently protected tags.
99- /// An item is protected if its tag is in this set, *and* it has the "protected" bit set.
10099 /// We add tags to this when they are created with a protector in `reborrow`, and
101100 /// we remove tags from this when the call which is protecting them returns, in
102101 /// `GlobalStateInner::end_call`. See `Stack::item_invalidated` for more details.
Original file line number Diff line number Diff line change @@ -7,9 +7,12 @@ use crate::borrow_tracker::BorTag;
77pub struct Item ( u64 ) ;
88
99// An Item contains 3 bitfields:
10- // * Bits 0-61 store a BorTag
11- // * Bits 61-63 store a Permission
12- // * Bit 64 stores a flag which indicates if we have a protector
10+ // * Bits 0-61 store a BorTag.
11+ // * Bits 61-63 store a Permission.
12+ // * Bit 64 stores a flag which indicates if we might have a protector.
13+ // This is purely an optimization: if the bit is set, the tag *might* be
14+ // in `protected_tags`, but if the bit is not set then the tag is definitely
15+ // not in `protected_tags`.
1316const TAG_MASK : u64 = u64:: MAX >> 3 ;
1417const PERM_MASK : u64 = 0x3 << 61 ;
1518const PROTECTED_MASK : u64 = 0x1 << 63 ;
You can’t perform that action at this time.
0 commit comments