From ea9ef33a7f7b08fdd2a350d55cb4bd116e667b16 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Sun, 31 Jul 2022 13:32:33 -0700 Subject: [PATCH] AK: Prefix CACHE_ALIGNED & SYSTEM_CACHE_ALIGNMENT_SIZE --- AK/Platform.h | 14 +++++++------- Userland/Libraries/LibCore/SharedCircularQueue.h | 6 +++--- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/AK/Platform.h b/AK/Platform.h index 0c60c11ff0b..95c7d3fd584 100644 --- a/AK/Platform.h +++ b/AK/Platform.h @@ -126,15 +126,15 @@ extern "C" { # define CLOCK_REALTIME_COARSE CLOCK_REALTIME #endif -#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE +#ifndef AK_SYSTEM_CACHE_ALIGNMENT_SIZE # if ARCH(AARCH64) || ARCH(x86_64) -# define SYSTEM_CACHE_ALIGNMENT_SIZE 64 +# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 64 # else -# define SYSTEM_CACHE_ALIGNMENT_SIZE 128 +# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 128 # endif -#endif /* SYSTEM_CACHE_ALIGNMENT_SIZE */ +#endif /* AK_SYSTEM_CACHE_ALIGNMENT_SIZE */ -#ifdef CACHE_ALIGNED -# undef CACHE_ALIGNED +#ifdef AK_CACHE_ALIGNED +# undef AK_CACHE_ALIGNED #endif -#define CACHE_ALIGNED alignas(SYSTEM_CACHE_ALIGNMENT_SIZE) +#define AK_CACHE_ALIGNED alignas(AK_SYSTEM_CACHE_ALIGNMENT_SIZE) diff --git a/Userland/Libraries/LibCore/SharedCircularQueue.h b/Userland/Libraries/LibCore/SharedCircularQueue.h index b863a60e5b1..b507b4274a9 100644 --- a/Userland/Libraries/LibCore/SharedCircularQueue.h +++ b/Userland/Libraries/LibCore/SharedCircularQueue.h @@ -168,9 +168,9 @@ private: // A full queue is signalled with: head - 1 mod size = tail mod size (i.e. head and tail point to the same index in the data array) // FIXME: These invariants aren't proven to be correct after each successful completion of each operation where it is relevant. // The work could be put in but for now I think the algorithmic correctness proofs of the functions are enough. - CACHE_ALIGNED Atomic m_tail { 0 }; - CACHE_ALIGNED Atomic m_head { 0 }; - CACHE_ALIGNED Atomic m_head_protector { NumericLimits::max() }; + AK_CACHE_ALIGNED Atomic m_tail { 0 }; + AK_CACHE_ALIGNED Atomic m_head { 0 }; + AK_CACHE_ALIGNED Atomic m_head_protector { NumericLimits::max() }; alignas(ValueType) Array m_data; };