UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
ClangPlatformAtomics.h
Go to the documentation of this file.
1// Copyright Epic Games, Inc. All Rights Reserved.
2
3/*=============================================================================================
4 ClangPlatformAtomics.h: Clang Atomics functions
5==============================================================================================*/
6
7#pragma once
8
9#ifdef __clang__
10
12#include "CoreTypes.h"
13
14// HEADER_UNIT_UNSUPPORTED - Clang not supporting header units
15
19struct FClangPlatformAtomics : public FGenericPlatformAtomics
20{
21 static FORCEINLINE int8 InterlockedIncrement(volatile int8* Value)
22 {
24 }
25
26 static FORCEINLINE int16 InterlockedIncrement(volatile int16* Value)
27 {
29 }
30
31 static FORCEINLINE int32 InterlockedIncrement(volatile int32* Value)
32 {
34 }
35
36 static FORCEINLINE int64 InterlockedIncrement(volatile int64* Value)
37 {
39 }
40
41 static FORCEINLINE int8 InterlockedDecrement(volatile int8* Value)
42 {
44 }
45
46 static FORCEINLINE int16 InterlockedDecrement(volatile int16* Value)
47 {
49 }
50
51 static FORCEINLINE int32 InterlockedDecrement(volatile int32* Value)
52 {
54 }
55
56 static FORCEINLINE int64 InterlockedDecrement(volatile int64* Value)
57 {
59 }
60
61 static FORCEINLINE int8 InterlockedAdd(volatile int8* Value, int8 Amount)
62 {
64 }
65
66 static FORCEINLINE int16 InterlockedAdd(volatile int16* Value, int16 Amount)
67 {
69 }
70
71 static FORCEINLINE int32 InterlockedAdd(volatile int32* Value, int32 Amount)
72 {
74 }
75
76 static FORCEINLINE int64 InterlockedAdd(volatile int64* Value, int64 Amount)
77 {
79 }
80
81 static FORCEINLINE int8 InterlockedExchange(volatile int8* Value, int8 Exchange)
82 {
84 }
85
86 static FORCEINLINE int16 InterlockedExchange(volatile int16* Value, int16 Exchange)
87 {
89 }
90
91 static FORCEINLINE int32 InterlockedExchange(volatile int32* Value, int32 Exchange)
92 {
94 }
95
96 static FORCEINLINE int64 InterlockedExchange(volatile int64* Value, int64 Exchange)
97 {
99 }
100
101 static FORCEINLINE void* InterlockedExchangePtr(void*volatile* Dest, void* Exchange)
102 {
104 }
105
107 {
109 return Comparand;
110 }
111
113 {
115 return Comparand;
116 }
117
119 {
121 return Comparand;
122 }
123
125 {
127 return Comparand;
128 }
129
130 static FORCEINLINE int8 InterlockedAnd(volatile int8* Value, const int8 AndValue)
131 {
133 }
134
135 static FORCEINLINE int16 InterlockedAnd(volatile int16* Value, const int16 AndValue)
136 {
138 }
139
140 static FORCEINLINE int32 InterlockedAnd(volatile int32* Value, const int32 AndValue)
141 {
143 }
144
145 static FORCEINLINE int64 InterlockedAnd(volatile int64* Value, const int64 AndValue)
146 {
148 }
149
150 static FORCEINLINE int8 InterlockedOr(volatile int8* Value, const int8 OrValue)
151 {
153 }
154
155 static FORCEINLINE int16 InterlockedOr(volatile int16* Value, const int16 OrValue)
156 {
158 }
159
160 static FORCEINLINE int32 InterlockedOr(volatile int32* Value, const int32 OrValue)
161 {
163 }
164
165 static FORCEINLINE int64 InterlockedOr(volatile int64* Value, const int64 OrValue)
166 {
168 }
169
170 static FORCEINLINE int8 InterlockedXor(volatile int8* Value, const int8 XorValue)
171 {
173 }
174
175 static FORCEINLINE int16 InterlockedXor(volatile int16* Value, const int16 XorValue)
176 {
178 }
179
180 static FORCEINLINE int32 InterlockedXor(volatile int32* Value, const int32 XorValue)
181 {
183 }
184
185 static FORCEINLINE int64 InterlockedXor(volatile int64* Value, const int64 XorValue)
186 {
188 }
189
190 static FORCEINLINE int8 AtomicRead(volatile const int8* Src)
191 {
193 }
194
195 static FORCEINLINE int16 AtomicRead(volatile const int16* Src)
196 {
198 }
199
200 static FORCEINLINE int32 AtomicRead(volatile const int32* Src)
201 {
203 }
204
205 static FORCEINLINE int64 AtomicRead(volatile const int64* Src)
206 {
208 }
209
210 static FORCEINLINE int8 AtomicRead_Relaxed(volatile const int8* Src)
211 {
213 }
214
215 static FORCEINLINE int16 AtomicRead_Relaxed(volatile const int16* Src)
216 {
218 }
219
220 static FORCEINLINE int32 AtomicRead_Relaxed(volatile const int32* Src)
221 {
223 }
224
225 static FORCEINLINE int64 AtomicRead_Relaxed(volatile const int64* Src)
226 {
228 }
229
230 static FORCEINLINE void AtomicStore(volatile int8* Src, int8 Val)
231 {
232 __atomic_store_n((volatile int8*)Src, Val, __ATOMIC_SEQ_CST);
233 }
234
235 static FORCEINLINE void AtomicStore(volatile int16* Src, int16 Val)
236 {
237 __atomic_store_n((volatile int16*)Src, Val, __ATOMIC_SEQ_CST);
238 }
239
240 static FORCEINLINE void AtomicStore(volatile int32* Src, int32 Val)
241 {
242 __atomic_store_n((volatile int32*)Src, Val, __ATOMIC_SEQ_CST);
243 }
244
245 static FORCEINLINE void AtomicStore(volatile int64* Src, int64 Val)
246 {
247 __atomic_store_n((volatile int64*)Src, Val, __ATOMIC_SEQ_CST);
248 }
249
250 static FORCEINLINE void AtomicStore_Relaxed(volatile int8* Src, int8 Val)
251 {
252 __atomic_store_n((volatile int8*)Src, Val, __ATOMIC_RELAXED);
253 }
254
255 static FORCEINLINE void AtomicStore_Relaxed(volatile int16* Src, int16 Val)
256 {
257 __atomic_store_n((volatile int16*)Src, Val, __ATOMIC_RELAXED);
258 }
259
260 static FORCEINLINE void AtomicStore_Relaxed(volatile int32* Src, int32 Val)
261 {
262 __atomic_store_n((volatile int32*)Src, Val, __ATOMIC_RELAXED);
263 }
264
265 static FORCEINLINE void AtomicStore_Relaxed(volatile int64* Src, int64 Val)
266 {
267 __atomic_store_n((volatile int64*)Src, Val, __ATOMIC_RELAXED);
268 }
269
270 static FORCEINLINE void* InterlockedCompareExchangePointer(void*volatile* Dest, void* Exchange, void* Comparand)
271 {
273 return Comparand;
274 }
275
276#if PLATFORM_HAS_128BIT_ATOMICS
288 {
290 }
291
292 static FORCEINLINE void AtomicRead128(const FInt128* Src, FInt128* OutResult)
293 {
295 }
296#endif
297
299 {
301 }
302};
303
304#endif
#define FORCEINLINE
Definition AndroidPlatform.h:140
#define PLATFORM_HAS_128BIT_ATOMICS
Definition ApplePlatform.h:15
FPlatformTypes::int16 int16
A 16-bit signed integer.
Definition Platform.h:1123
FPlatformTypes::int8 int8
An 8-bit signed integer.
Definition Platform.h:1121
FPlatformTypes::int64 int64
A 64-bit signed integer.
Definition Platform.h:1127
FPlatformTypes::int32 int32
A 32-bit signed integer.
Definition Platform.h:1125
UE_FORCEINLINE_HINT TSharedRef< CastToType, Mode > StaticCastSharedRef(TSharedRef< CastFromType, Mode > const &InSharedRef)
Definition SharedPointer.h:127
bool InterlockedCompareExchange(const FIndexedPointer &Exchange, const FIndexedPointer &Comparand)
Definition LockFreeList.h:65
void AtomicRead(const FIndexedPointer &Other)
Definition LockFreeList.h:58
float Val(const FString &Value)
Definition UnrealMath.cpp:3163
UE_REWRITE constexpr void Exchange(T &A, T &B)
Definition UnrealTemplate.h:627
Definition GenericPlatformAtomics.h:26
static FORCEINLINE bool CanUseCompareExchange128()
Definition GenericPlatformAtomics.h:313