Kernel: Use AK::is_power_of_two instead of AK::popcount in kmalloc_impl

AK::popcount will use floating-point instructions, which in the aarch64
kernel are not allowed, and will result in an exception.
This commit is contained in:
Timon Kruiper 2022-12-20 15:42:48 +01:00 committed by Sam Atkins
commit 344ffda8cb
Notes: sideshowbarker 2024-07-17 02:55:30 +09:00

View file

@ -431,7 +431,7 @@ static void* kmalloc_impl(size_t size, size_t alignment, CallerWillInitializeMem
}
// Alignment must be a power of two.
VERIFY(popcount(alignment) == 1);
VERIFY(is_power_of_two(alignment));
SpinlockLocker lock(s_lock);
++g_kmalloc_call_count;