1#ifndef _BITMAP_H_INCLUDED
2#define _BITMAP_H_INCLUDED
12 return (num_entries + 7) / 8;
22 return 1 << (
entry % 8);
static bool bitmap_get(bitmap_t bitmap, uint64_t entry)
Retrieve state of the given entry from bitmap.
static uint8_t bitmap_bit(uint64_t entry)
Return the bitmask for the given bitmap index.
static size_t bitmap_size(size_t num_entries)
Return the size of the bitmap in bytes for a given amount of entries.
static uint64_t bitmap_idx(uint64_t entry)
Return the index in the bitmap array for the given bitmap index.
uint8_t * bitmap_t
Type for a single entry in the array.
static void bitmap_clear(bitmap_t bitmap, uint64_t entry)
Unset given entry in bitmap.
static void bitmap_set(bitmap_t bitmap, uint64_t entry)
Set given entry in bitmap.