Skip to content

Commit

Permalink
Add SlotId::tag
Browse files Browse the repository at this point in the history
  • Loading branch information
marc0246 committed Jul 8, 2024
1 parent cbc9779 commit a65c764
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,11 @@ impl SlotId {
pub const fn generation(self) -> u32 {
self.generation.get()
}

#[inline(always)]
pub const fn tag(self) -> u32 {
self.generation() & !TAG_MASK
}
}

pub struct Ref<'a, T> {
Expand Down

0 comments on commit a65c764

Please sign in to comment.