28#include <l4/cxx/bitmap>
30namespace L4Re {
namespace Util {
46 bool is_allocated(
long item)
const noexcept
47 {
return _bits[item]; }
49 long hint()
const {
return _free_hint; }
51 bool alloc(
long item)
noexcept
61 void free(
long item)
noexcept
63 if (item < _free_hint)
70 : _capacity(size), _free_hint(0), _bits(mem)
75 if (_free_hint >= _capacity)
78 long free = _bits.
scan_zero(_capacity, _free_hint);
87 long size()
const noexcept
Helper abstraction for a word contained in the bitmap.
Basic bitmap abstraction.
long scan_zero(long max_bit, long start_bit=0) const noexcept
Scan for the first zero bit.
void clear_bit(long bit) noexcept
Clear bit bit.
void set_bit(long bit) noexcept
Set bit bit.