| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | |
| 2 // for details. All rights reserved. Use of this source code is governed by a | |
| 3 // BSD-style license that can be found in the LICENSE file. | |
| 4 | |
| 5 #include "platform/globals.h" | |
| 6 #if defined(TARGET_OS_WINDOWS) | |
| 7 | |
| 8 #include "vm/atomic.h" | |
| 9 | |
| 10 namespace dart { | |
| 11 | |
| 12 | |
| 13 uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) { | |
| 14 #if defined(TARGET_ARCH_X64) | |
| 15 return static_cast<uintptr_t>( | |
| 16 InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p))) - 1; | |
| 17 #elif defined(TARGET_ARCH_IA32) | |
| 18 return static_cast<uintptr_t>( | |
| 19 InterlockedIncrement(reinterpret_cast<LONG*>(p))) - 1; | |
| 20 #else | |
| 21 UNIMPLEMENTED(); | |
| 22 #endif | |
| 23 } | |
| 24 | |
| 25 | |
| 26 } // namespace dart | |
| 27 | |
| 28 #endif // defined(TARGET_OS_WINDOWS) | |
| OLD | NEW |