1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 23:07:35 +00:00

Kernel: Add sanity check assertion in RangeAllocator::allocate_anywhere

The requested alignment should always be a multiple of the page size.
This commit is contained in:
Andreas Kling 2021-01-28 14:40:14 +01:00
parent 509e5a3045
commit 27d07796b4

View file

@ -112,6 +112,7 @@ Optional<Range> RangeAllocator::allocate_anywhere(size_t size, size_t alignment)
return {};
ASSERT((size % PAGE_SIZE) == 0);
ASSERT((alignment % PAGE_SIZE) == 0);
#ifdef VM_GUARD_PAGES
// NOTE: We pad VM allocations with a guard page on each side.