| Index: runtime/vm/atomic_win.h
|
| diff --git a/runtime/vm/atomic_win.h b/runtime/vm/atomic_win.h
|
| index 8e07cd3d20b2330f60d2cc3a8d9e009af41843b6..4172ec443c4a1d1a190252872f1b83b2f3647941 100644
|
| --- a/runtime/vm/atomic_win.h
|
| +++ b/runtime/vm/atomic_win.h
|
| @@ -28,6 +28,22 @@ inline uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
|
| }
|
|
|
|
|
| +inline intptr_t AtomicOperations::FetchAndIncrementBy(intptr_t* p,
|
| + intptr_t value) {
|
| +#if defined(HOST_ARCH_X64)
|
| + return static_cast<intptr_t>(
|
| + InterlockedAdd64(reinterpret_cast<LONGLONG*>(p),
|
| + static_cast<LONGLONG>(value))) - value;
|
| +#elif defined(HOST_ARCH_IA32)
|
| + return static_cast<intptr_t>(
|
| + InterlockedAdd(reinterpret_cast<LONG*>(p),
|
| + static_cast<LONGLONG>(value))) - value;
|
| +#else
|
| +#error Unsupported host architecture.
|
| +#endif
|
| +}
|
| +
|
| +
|
| inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
|
| #if defined(HOST_ARCH_X64)
|
| return static_cast<uintptr_t>(
|
| @@ -41,6 +57,22 @@ inline uintptr_t AtomicOperations::FetchAndDecrement(uintptr_t* p) {
|
| }
|
|
|
|
|
| +inline intptr_t AtomicOperations::FetchAndDecrementBy(intptr_t* p,
|
| + intptr_t value) {
|
| +#if defined(HOST_ARCH_X64)
|
| + return static_cast<intptr_t>(
|
| + InterlockedAdd64(reinterpret_cast<LONGLONG*>(p),
|
| + static_cast<LONGLONG>(-value))) + value;
|
| +#elif defined(HOST_ARCH_IA32)
|
| + return static_cast<intptr_t>(
|
| + InterlockedAdd(reinterpret_cast<LONG*>(p),
|
| + static_cast<LONGLONG>(-value))) + value;
|
| +#else
|
| +#error Unsupported host architecture.
|
| +#endif
|
| +}
|
| +
|
| +
|
| #if !defined(USING_SIMULATOR)
|
| inline uword AtomicOperations::CompareAndSwapWord(uword* ptr,
|
| uword old_value,
|
|
|