From a9cdab1e49cf51cf5c966fbb10c7bb7cd08a5ddf Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sun, 8 Apr 2018 10:36:24 -0700 Subject: [PATCH] ircd::allocator: Assertions on state bits. --- include/ircd/allocator.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/ircd/allocator.h b/include/ircd/allocator.h index 60d499c40..9a80b3099 100644 --- a/include/ircd/allocator.h +++ b/include/ircd/allocator.h @@ -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;