From 344ffda8cb83b8a441d2a95eaf57c6eb813495b5 Mon Sep 17 00:00:00 2001 From: Timon Kruiper Date: Tue, 20 Dec 2022 15:42:48 +0100 Subject: [PATCH] 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. --- Kernel/Heap/kmalloc.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Kernel/Heap/kmalloc.cpp b/Kernel/Heap/kmalloc.cpp index 57ed0dedc5..96f6d4fd35 100644 --- a/Kernel/Heap/kmalloc.cpp +++ b/Kernel/Heap/kmalloc.cpp @@ -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;