From 5e0a28c947f8dbec8bc66e90270de80f722fd402 Mon Sep 17 00:00:00 2001 From: Ali Mohammad Pur Date: Thu, 14 Sep 2023 14:36:00 +0330 Subject: [PATCH] =?UTF-8?q?Revert=20"AK:=20Align=20Function=20storage=20to?= =?UTF-8?q?=20=5F=5FBIGGEST=5FALIGNMENT=5F=5F=20outside=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit …kernel" This reverts commit d4d92184b332628f35413f92918da09d4378a52c. The alignemnt requirements imposed by this are overkill at best and ridiculous at worst, a future commit will tackle this problem in a different, more space-efficient way. --- AK/Function.h | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/AK/Function.h b/AK/Function.h index c529ea5864..d295843b77 100644 --- a/AK/Function.h +++ b/AK/Function.h @@ -284,13 +284,11 @@ private: #ifndef KERNEL // Empirically determined to fit most lambdas and functions. static constexpr size_t inline_capacity = 4 * sizeof(void*); - alignas(__BIGGEST_ALIGNMENT__) u8 m_storage[inline_capacity]; #else // FIXME: Try to decrease this. static constexpr size_t inline_capacity = 6 * sizeof(void*); - // In the Kernel nothing has an alignment > alignof(void*). - alignas(alignof(void*)) u8 m_storage[inline_capacity]; #endif + alignas(max(alignof(CallableWrapperBase), alignof(CallableWrapperBase*))) u8 m_storage[inline_capacity]; }; }