From 9c6c2284d9dbbe35deea8a322c4774df62752564 Mon Sep 17 00:00:00 2001 From: Sergey Bugaev Date: Sat, 4 Nov 2023 20:26:58 +0300 Subject: [PATCH] LibJS: Fix build error when some atomics are not lock-free Normally, we want to avoid accidentally using such atomics, since they're much slower. In this case however, we're just implementing another atomics API, it is then up to the JavaScript code to avoid using the slow atomics. --- Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp index de9bfaf96a..d8d1682996 100644 --- a/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp +++ b/Userland/Libraries/LibJS/Runtime/AtomicsObject.cpp @@ -4,6 +4,14 @@ * SPDX-License-Identifier: BSD-2-Clause */ +// This file explicitly implements support for JS Atomics API, which can +// involve slow (non-lock-free) atomic ops. +#include + +#ifdef AK_COMPILER_CLANG +# pragma clang diagnostic ignored "-Watomic-alignment" +#endif + #include #include #include