10 #if defined(_MSC_VER) && (defined(_M_X64) || defined(_M_IX86)) 42 template <
typename TYPE>
44 TYPE
const * i_atomic,
45 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept = delete;
73 template <typename TYPE>
77 std::memory_order i_memory_order =
std::memory_order_seq_cst) noexcept = delete;
105 template <typename TYPE>
110 std::memory_order i_success,
111 std::memory_order i_failure) noexcept = delete;
139 template <typename TYPE>
144 std::memory_order i_success,
145 std::memory_order i_failure) noexcept = delete;
147 #if defined(_MSC_VER) && (defined(_M_X64) | defined(_M_IX86)) 150 uint32_t
const * i_atomic,
151 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
155 switch (i_memory_order)
157 case std::memory_order_relaxed:
162 case std::memory_order_consume:
163 case std::memory_order_acquire:
164 case std::memory_order_seq_cst:
166 auto const value = *i_atomic;
175 uint64_t
const * i_atomic,
176 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
180 switch (i_memory_order)
182 case std::memory_order_relaxed:
187 case std::memory_order_consume:
188 case std::memory_order_acquire:
189 case std::memory_order_seq_cst:
191 auto const value = *i_atomic;
202 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
206 switch (i_memory_order)
208 case std::memory_order_relaxed:
212 case std::memory_order_release:
217 case std::memory_order_seq_cst:
218 _InterlockedExchange(reinterpret_cast<long *>(i_atomic), static_cast<long>(i_value));
230 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
234 switch (i_memory_order)
236 case std::memory_order_relaxed:
240 case std::memory_order_release:
245 case std::memory_order_seq_cst:
246 _InterlockedExchange64(
247 reinterpret_cast<long long *>(i_atomic), static_cast<long long>(i_value));
258 uint32_t * i_expected,
260 std::memory_order i_success,
261 std::memory_order i_failure) noexcept
266 long const prev_val = _InterlockedCompareExchange(
267 reinterpret_cast<long *>(i_atomic), (
long)i_desired, *(
long *)i_expected);
268 if (prev_val == *(
long *)i_expected)
274 *i_expected = (long)prev_val;
282 uint64_t * i_expected,
284 std::memory_order i_success,
285 std::memory_order i_failure) noexcept
290 long long const prev_val = _InterlockedCompareExchange64(
291 reinterpret_cast<long long *>(i_atomic), (
long long)i_desired, *(
long long *)i_expected);
292 if (prev_val == *(
long long *)i_expected)
298 *i_expected = (
long long)prev_val;
306 uint32_t * i_expected,
308 std::memory_order i_success,
309 std::memory_order i_failure) noexcept
312 i_atomic, i_expected, i_desired, i_success, i_failure);
319 uint64_t * i_expected,
321 std::memory_order i_success,
322 std::memory_order i_failure) noexcept
325 i_atomic, i_expected, i_desired, i_success, i_failure);
330 #elif defined(__GNUG__) // gcc and clang 334 inline int mem_order_cnv(std::memory_order i_order)
338 case std::memory_order_acq_rel:
339 return __ATOMIC_ACQ_REL;
340 case std::memory_order_acquire:
341 return __ATOMIC_ACQUIRE;
342 case std::memory_order_consume:
343 return __ATOMIC_CONSUME;
344 case std::memory_order_relaxed:
345 return __ATOMIC_RELAXED;
346 case std::memory_order_release:
347 return __ATOMIC_RELEASE;
348 case std::memory_order_seq_cst:
350 return __ATOMIC_SEQ_CST;
356 uintptr_t
const * i_atomic,
357 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
361 return __atomic_load_n(i_atomic, detail::mem_order_cnv(i_memory_order));
365 uintptr_t * i_atomic,
367 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
371 __atomic_store_n(i_atomic, i_value, detail::mem_order_cnv(i_memory_order));
375 uintptr_t * i_atomic,
376 uintptr_t * i_expected,
378 std::memory_order i_success,
379 std::memory_order i_failure) noexcept
383 return __atomic_compare_exchange_n(
388 detail::mem_order_cnv(i_success),
389 detail::mem_order_cnv(i_failure));
393 uintptr_t * i_atomic,
394 uintptr_t * i_expected,
396 std::memory_order i_success,
397 std::memory_order i_failure) noexcept
399 return __atomic_compare_exchange_n(
404 detail::mem_order_cnv(i_success),
405 detail::mem_order_cnv(i_failure));
436 template <
typename TYPE>
441 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
444 i_atomic, i_expected, i_desired, i_memory_order, i_memory_order);
473 template <
typename TYPE>
478 std::memory_order i_memory_order = std::memory_order_seq_cst) noexcept
481 i_atomic, i_expected, i_desired, i_memory_order, i_memory_order);
TYPE raw_atomic_load(TYPE const *i_atomic, std::memory_order i_memory_order=std::memory_order_seq_cst) noexcept=delete
Definition: conc_function_queue.h:11
Definition: runtime_type.h:1061
bool raw_atomic_compare_exchange_strong(TYPE *i_atomic, TYPE *i_expected, TYPE i_desired, std::memory_order i_success, std::memory_order i_failure) noexcept=delete
#define DENSITY_ASSUME_ALIGNED(address, constexpr_alignment)
Definition: density_config.h:59
#define DENSITY_ASSUME(bool_expr,...)
Definition: density_config.h:46
bool raw_atomic_compare_exchange_weak(TYPE *i_atomic, TYPE *i_expected, TYPE i_desired, std::memory_order i_success, std::memory_order i_failure) noexcept=delete
void raw_atomic_store(TYPE *i_atomic, TYPE i_value, std::memory_order i_memory_order=std::memory_order_seq_cst) noexcept=delete