Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1650)

Unified Diff: runtime/vm/atomic_win.cc

Issue 109803002: Profiler Take 2 (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: runtime/vm/atomic_win.cc
diff --git a/runtime/vm/atomic_win.cc b/runtime/vm/atomic_win.cc
new file mode 100644
index 0000000000000000000000000000000000000000..b736041eb4523eb7c988a5d855a6cf69aa07aa04
--- /dev/null
+++ b/runtime/vm/atomic_win.cc
@@ -0,0 +1,28 @@
+// Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file
+// for details. All rights reserved. Use of this source code is governed by a
+// BSD-style license that can be found in the LICENSE file.
+
+#include "platform/globals.h"
+#if defined(TARGET_OS_WINDOWS)
+
+#include "vm/atomic.h"
+
+namespace dart {
+
+
+uintptr_t AtomicOperations::FetchAndIncrement(uintptr_t* p) {
+#if defined(TARGET_ARCH_X64)
+ return static_cast<uintptr_t>(
+ InterlockedIncrement64(reinterpret_cast<LONGLONG*>(p)) - 1);
+#elif defined(TARGET_ARCH_IA32)
+ return static_cast<uintptr_t>(
+ InterlockedIncrement(reinterpret_cast<LONG*>(p)) - 1);
+#else
+ UNIMPLEMENTED();
+#endif
+}
+
+
+} // namespace dart
+
+#endif // defined(TARGET_OS_WINDOWS)

Powered by Google App Engine
This is Rietveld 408576698