From 9dcb7ca673d1d92fc4f2e88235ce34709af8d7ac Mon Sep 17 00:00:00 2001 From: Jamie Reece Wilson Date: Mon, 18 Mar 2024 07:12:21 +0000 Subject: [PATCH] [+] Atomic load/store pointer --- Include/auROXTL/auAtomic.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/Include/auROXTL/auAtomic.hpp b/Include/auROXTL/auAtomic.hpp index 4709c03..b8be2cf 100644 --- a/Include/auROXTL/auAtomic.hpp +++ b/Include/auROXTL/auAtomic.hpp @@ -428,6 +428,11 @@ inline auline T AuAtomicUtils::LoadWeak(T *in) template inline auline T AuAtomicUtils::Load(T *in) { + if constexpr (AuIsPointer_v) + { + return (T)AuAtomicUtils::Load((AuUInt *)in); + } + #if defined(AURORA_COMPILER_MSVC) && (defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)) const auto read = *in; ::_ReadWriteBarrier(); @@ -486,6 +491,12 @@ inline auline T AuAtomicUtils::Load(T *in) template inline auline void AuAtomicUtils::Store(T *in, T val) { + if constexpr (AuIsPointer_v) + { + AuAtomicUtils::Store((AuUInt *)in, (AuUInt)val); + return; + } + #if defined(AURORA_COMPILER_MSVC) && (defined(AURORA_ARCH_X64) || defined(AURORA_ARCH_X86)) *in = val; #elif defined(AURORA_COMPILER_MSVC)