mirror of
https://github.com/matrix-construct/construct
synced 2024-12-28 16:34:13 +01:00
ircd::allocator: Assertions on state bits.
This commit is contained in:
parent
dcd343356d
commit
a9cdab1e49
1 changed files with 6 additions and 0 deletions
|
@ -407,7 +407,10 @@ ircd::allocator::state::deallocate(const uint &pos,
|
|||
const size_type &n)
|
||||
{
|
||||
for(size_t i(0); i < n; ++i)
|
||||
{
|
||||
assert(test(pos + i));
|
||||
btc(pos + i);
|
||||
}
|
||||
|
||||
last = pos;
|
||||
}
|
||||
|
@ -421,7 +424,10 @@ ircd::allocator::state::allocate(const size_type &n,
|
|||
throw std::bad_alloc();
|
||||
|
||||
for(size_t i(0); i < n; ++i)
|
||||
{
|
||||
assert(!test(next + i));
|
||||
bts(next + i);
|
||||
}
|
||||
|
||||
last = next + n;
|
||||
return next;
|
||||
|
|
Loading…
Reference in a new issue