1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 09:38:11 +00:00

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
parent 81571bdac9
commit 344ffda8cb

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;