bit_packed_atomic_flags implements a container for garbage collection flags that is only thread unsafe on calls to setup. This class bit‐packs collection flags for memory efficiency.
Synopsis
Declared in <cuckoocache.h>
class bit_packed_atomic_flags;
Description
All operations are std::memory_order_relaxed so external mechanisms must ensure that writes and reads are properly synchronized.
On setup(n), all bits up to n are marked as collected.
Under the hood, because it is an 8‐bit type, it makes sense to use a multiple of 8 for setup, but it will be safe if that is not the case as well.
Member Functions
Name |
Description |
|
Constructors |
bit_is_set queries the table for discardability at |
|
bit_set sets an entry as discardable. |
|
bit_unset marks an entry as something that should not be overwritten. |
|
setup marks all entries and ensures that bit_packed_atomic_flags can store at least |
Created with MrDocs