From 006de308b5603b104e7963136ade29dc0c600d69 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B6nke=20Holz?= Date: Thu, 30 Jul 2026 13:40:00 +0200 Subject: [PATCH] AK+DynamicLoader: Move optimizer_fence() into AK This will allow us to use this function in other places. --- AK/Fences.h | 6 ++++++ Userland/DynamicLoader/main.cpp | 6 +----- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/AK/Fences.h b/AK/Fences.h index 9e93679e5eb..c9170b5669d 100644 --- a/AK/Fences.h +++ b/AK/Fences.h @@ -20,9 +20,15 @@ static inline void atomic_thread_fence(MemoryOrder order) noexcept return __atomic_thread_fence(order); } +static inline void optimizer_fence() +{ + asm volatile("" ::: "memory"); +} + } #if USING_AK_GLOBALLY using AK::atomic_signal_fence; using AK::atomic_thread_fence; +using AK::optimizer_fence; #endif diff --git a/Userland/DynamicLoader/main.cpp b/Userland/DynamicLoader/main.cpp index 6857aa5f44b..bd6aad93468 100644 --- a/Userland/DynamicLoader/main.cpp +++ b/Userland/DynamicLoader/main.cpp @@ -4,6 +4,7 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include #include #include #include @@ -147,11 +148,6 @@ NAKED void _start(int, char**, char**) #endif } -ALWAYS_INLINE static void optimizer_fence() -{ - asm("" ::: "memory"); -} - [[gnu::no_stack_protector]] void _entry(int argc, char** argv, char** envp) { char** env;