[−][src]Trait cuckoocache::bitpacked::FlagsT
Associated Constants
Loading content...Required methods
fn new(size: usize) -> Self
constructor creates memory to sufficiently keep track of garbage collection information for size entries.
Arguments
size
the number of elements to allocate space for
Postconditions
- bit_set, bit_unset, and bit_is_set function properly forall x. x < size.
- All calls to bit_is_set (without subsequent bit_unset) will return
Self::DEFAULT
.
fn setup(&mut self, b: usize)
setup marks all entries and ensures that bit_packed_atomic_flags can store at least size entries
Arguments
b
the number of elements to allocate space for
Postconditions
- bit_set, bit_unset, and bit_is_set function properly forall x. x < b
- All calls to bit_is_set (without subsequent bit_unset) will return
Self::DEFAULT
.
fn bit_set(&mut self, s: usize)
bit_set sets an entry as discardable.
Arguments
s
the index of the entry to bit_set
Postconditions
- immediately subsequent call (assuming proper external memory ordering) to bit_is_set(s) == true.
fn bit_unset(&mut self, s: usize)
bit_unset marks an entry as something that should not be overwritten
Arguments
s
the index of the entry to bit_unset
Postconditions
- immediately subsequent call (assuming proper external memory ordering) to bit_is_set(s) == false.
fn bit_set_to(&mut self, s: usize, discardable: bool)
bit_set_to sets an entry as specified.
Arguments
s
the index of the entry to modifydiscardable
true does unset, false does set
Postconditions
- immediately subsequent call (assuming proper external memory ordering) to bit_is_set(s) == true.