[#CuckooCache-bit_packed_atomic_flags]
= xref:CuckooCache.adoc[CuckooCache]::bit&lowbar;packed&lowbar;atomic&lowbar;flags
:relfileprefix: ../
:mrdocs:

xref:CuckooCache/bit_packed_atomic_flags/2constructor-0e.adoc[`bit&lowbar;packed&lowbar;atomic&lowbar;flags`] implements a container for garbage collection flags that is only thread unsafe on calls to setup&period; This class bit&hyphen;packs collection flags for memory efficiency&period;

== Synopsis

Declared in `&lt;cuckoocache&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
class bit&lowbar;packed&lowbar;atomic&lowbar;flags;
----

== Description

All operations are `std&colon;&colon;memory&lowbar;order&lowbar;relaxed` so external mechanisms must ensure that writes and reads are properly synchronized&period;

On setup(n), all bits up to `n` are marked as collected&period;

Under the hood, because it is an 8&hyphen;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&period;

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:CuckooCache/bit_packed_atomic_flags/2constructor-0e.adoc[`bit&lowbar;packed&lowbar;atomic&lowbar;flags`]         [.small]#[constructor]#
| Constructors
| xref:CuckooCache/bit_packed_atomic_flags/bit_is_set.adoc[`bit&lowbar;is&lowbar;set`] 
| bit&lowbar;is&lowbar;set queries the table for discardability at `s`&period;
| xref:CuckooCache/bit_packed_atomic_flags/bit_set.adoc[`bit&lowbar;set`] 
| bit&lowbar;set sets an entry as discardable&period;
| xref:CuckooCache/bit_packed_atomic_flags/bit_unset.adoc[`bit&lowbar;unset`] 
| bit&lowbar;unset marks an entry as something that should not be overwritten&period;
| xref:CuckooCache/bit_packed_atomic_flags/setup.adoc[`setup`] 
| setup marks all entries and ensures that bit&lowbar;packed&lowbar;atomic&lowbar;flags can store at least `b` entries&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
