| 52 | |
| 53 | template<typename T> |
| 54 | DEATH_ALWAYS_INLINE T ExchangePointer(T volatile* destination, T value) |
| 55 | { |
| 56 | #if defined(DEATH_TARGET_MSVC) |
| 57 | # if !defined(DEATH_TARGET_32BIT) |
| 58 | return (T)_InterlockedExchangePointer((void* volatile*)destination, value); |
| 59 | # else |
| 60 | return (T)_InterlockedExchange((long volatile*)(void* volatile*)destination, (long)(void*)value); |
| 61 | # endif |
| 62 | #else |
| 63 | T result = (T)__atomic_exchange_n((void* volatile*)destination, value, __ATOMIC_ACQ_REL); |
| 64 | InterlockedOperationBarrier(); |
| 65 | return result; |
| 66 | #endif |
| 67 | } |
| 68 | |
| 69 | template<typename T> |
| 70 | DEATH_ALWAYS_INLINE T ExchangePointer(T volatile* destination, std::nullptr_t value) |
no test coverage detected