0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-09-27 11:18:51 +02:00

ircd::allocator: Set last state to dealloc pos for no-rotate reuse; minor cleanup.

This commit is contained in:
Jason Volk 2018-04-08 10:26:54 -07:00
parent eb1d1c2482
commit 42242edd29

View file

@ -51,8 +51,9 @@ struct ircd::allocator::state
bool test(const uint &pos) const { return avail[byte(pos)] & mask(pos); }
void bts(const uint &pos) { avail[byte(pos)] |= mask(pos); }
void btc(const uint &pos) { avail[byte(pos)] &= ~mask(pos); }
uint next(const size_t &n) const;
public:
void deallocate(const uint &p, const size_t &n);
uint allocate(const size_t &n, const uint &hint = -1);
@ -407,6 +408,8 @@ ircd::allocator::state::deallocate(const uint &pos,
{
for(size_t i(0); i < n; ++i)
btc(pos + i);
last = pos;
}
inline uint