mirror of
https://github.com/SerenityOS/serenity
synced 2024-07-09 01:30:46 +00:00
AK: Prefix CACHE_ALIGNED & SYSTEM_CACHE_ALIGNMENT_SIZE
This commit is contained in:
parent
5f253988ef
commit
ea9ef33a7f
|
@ -126,15 +126,15 @@ extern "C" {
|
||||||
# define CLOCK_REALTIME_COARSE CLOCK_REALTIME
|
# define CLOCK_REALTIME_COARSE CLOCK_REALTIME
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef SYSTEM_CACHE_ALIGNMENT_SIZE
|
#ifndef AK_SYSTEM_CACHE_ALIGNMENT_SIZE
|
||||||
# if ARCH(AARCH64) || ARCH(x86_64)
|
# if ARCH(AARCH64) || ARCH(x86_64)
|
||||||
# define SYSTEM_CACHE_ALIGNMENT_SIZE 64
|
# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 64
|
||||||
# else
|
# else
|
||||||
# define SYSTEM_CACHE_ALIGNMENT_SIZE 128
|
# define AK_SYSTEM_CACHE_ALIGNMENT_SIZE 128
|
||||||
# endif
|
# endif
|
||||||
#endif /* SYSTEM_CACHE_ALIGNMENT_SIZE */
|
#endif /* AK_SYSTEM_CACHE_ALIGNMENT_SIZE */
|
||||||
|
|
||||||
#ifdef CACHE_ALIGNED
|
#ifdef AK_CACHE_ALIGNED
|
||||||
# undef CACHE_ALIGNED
|
# undef AK_CACHE_ALIGNED
|
||||||
#endif
|
#endif
|
||||||
#define CACHE_ALIGNED alignas(SYSTEM_CACHE_ALIGNMENT_SIZE)
|
#define AK_CACHE_ALIGNED alignas(AK_SYSTEM_CACHE_ALIGNMENT_SIZE)
|
||||||
|
|
|
@ -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)
|
// 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.
|
// 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.
|
// The work could be put in but for now I think the algorithmic correctness proofs of the functions are enough.
|
||||||
CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_tail { 0 };
|
AK_CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_tail { 0 };
|
||||||
CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_head { 0 };
|
AK_CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_head { 0 };
|
||||||
CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_head_protector { NumericLimits<size_t>::max() };
|
AK_CACHE_ALIGNED Atomic<size_t, AK::MemoryOrder::memory_order_seq_cst> m_head_protector { NumericLimits<size_t>::max() };
|
||||||
|
|
||||||
alignas(ValueType) Array<ValueType, Size> m_data;
|
alignas(ValueType) Array<ValueType, Size> m_data;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user