|
ReXGlue SDK
|
#include <rex/bit.h>
Public Member Functions | |
| BitMap (size_t size_bits) | |
| BitMap (u64 *data, size_t size_bits) | |
| size_t | AcquireEntry () |
| void | ReleaseEntry (size_t index) |
| void | Resize (size_t new_size_bits) |
| void | Reset () |
| const std::vector< u64 > | GetWords () const |
| std::vector< u64 > & | GetWords () |
Bitmap of free and used entries where a set bit marks a free entry.
| rex::BitMap::BitMap | ( | size_t | size_bits | ) |
Creates a bitmap with every entry free.
| size_bits | Number of entries, a multiple of 64. |
| rex::BitMap::BitMap | ( | u64 * | data, |
| size_t | size_bits ) |
Creates a bitmap initialized from existing words.
| data | Source words, 8 byte alignment preferred but not required. |
| size_bits | Number of entries, a multiple of 64. |
| size_t rex::BitMap::AcquireEntry | ( | ) |
Atomically marks the first free entry as used. Thread safe.
|
inline |
Returns a copy of the backing words.
| void rex::BitMap::ReleaseEntry | ( | size_t | index | ) |
Atomically marks an entry as free. Thread safe.
| void rex::BitMap::Resize | ( | size_t | new_size_bits | ) |
Resizes the bitmap. New entries start free.
| new_size_bits | Number of entries, a multiple of 64. |