Kernel: Add some sanity assertions in RangeAllocator::deallocate()

We should never end up deallocating an empty range, or a range that
ends before it begins.
This commit is contained in:
Andreas Kling 2020-01-30 21:50:23 +01:00
parent 31a141bd10
commit bf5b7c32d8
Notes: sideshowbarker 2024-07-19 09:44:49 +09:00

View File

@ -151,6 +151,8 @@ Range RangeAllocator::allocate_specific(VirtualAddress base, size_t size)
void RangeAllocator::deallocate(Range range)
{
ASSERT(m_total_range.contains(range));
ASSERT(range.size());
ASSERT(range.base() < range.end());
#ifdef VRA_DEBUG
dbgprintf("VRA: Deallocate: %x(%u)\n", range.base().get(), range.size());