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

Side by Side Diff: runtime/vm/atomic.h

Issue 2481873005: clang-format runtime/vm (Closed)
Patch Set: Merge Created 4 years, 1 month 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 unified diff | Download patch
« no previous file with comments | « runtime/vm/ast_transformer.cc ('k') | runtime/vm/atomic_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file 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 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. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #ifndef RUNTIME_VM_ATOMIC_H_ 5 #ifndef RUNTIME_VM_ATOMIC_H_
6 #define RUNTIME_VM_ATOMIC_H_ 6 #define RUNTIME_VM_ATOMIC_H_
7 7
8 #include "platform/globals.h" 8 #include "platform/globals.h"
9 9
10 #include "vm/allocation.h" 10 #include "vm/allocation.h"
(...skipping 30 matching lines...) Expand all
41 // 41 //
42 // NOTE: Not to be used for any atomic operations involving memory locations 42 // NOTE: Not to be used for any atomic operations involving memory locations
43 // that are accessed by generated code. 43 // that are accessed by generated code.
44 static void DecrementBy(intptr_t* p, intptr_t value); 44 static void DecrementBy(intptr_t* p, intptr_t value);
45 45
46 // Atomically compare *ptr to old_value, and if equal, store new_value. 46 // Atomically compare *ptr to old_value, and if equal, store new_value.
47 // Returns the original value at ptr. 47 // Returns the original value at ptr.
48 // 48 //
49 // NOTE: OK to use with memory locations that are accessed by generated code 49 // NOTE: OK to use with memory locations that are accessed by generated code
50 static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value); 50 static uword CompareAndSwapWord(uword* ptr, uword old_value, uword new_value);
51 static uint32_t CompareAndSwapUint32( 51 static uint32_t CompareAndSwapUint32(uint32_t* ptr,
52 uint32_t* ptr, uint32_t old_value, uint32_t new_value); 52 uint32_t old_value,
53 uint32_t new_value);
53 54
54 // Performs a load of a word from 'ptr', but without any guarantees about 55 // Performs a load of a word from 'ptr', but without any guarantees about
55 // memory order (i.e., no load barriers/fences). 56 // memory order (i.e., no load barriers/fences).
56 template <typename T> 57 template <typename T>
57 static T LoadRelaxed(T* ptr) { 58 static T LoadRelaxed(T* ptr) {
58 return *static_cast<volatile T*>(ptr); 59 return *static_cast<volatile T*>(ptr);
59 } 60 }
60 }; 61 };
61 62
62 63
(...skipping 17 matching lines...) Expand all
80 #include "vm/atomic_linux.h" 81 #include "vm/atomic_linux.h"
81 #elif defined(TARGET_OS_MACOS) 82 #elif defined(TARGET_OS_MACOS)
82 #include "vm/atomic_macos.h" 83 #include "vm/atomic_macos.h"
83 #elif defined(TARGET_OS_WINDOWS) 84 #elif defined(TARGET_OS_WINDOWS)
84 #include "vm/atomic_win.h" 85 #include "vm/atomic_win.h"
85 #else 86 #else
86 #error Unknown target os. 87 #error Unknown target os.
87 #endif 88 #endif
88 89
89 #endif // RUNTIME_VM_ATOMIC_H_ 90 #endif // RUNTIME_VM_ATOMIC_H_
OLDNEW
« no previous file with comments | « runtime/vm/ast_transformer.cc ('k') | runtime/vm/atomic_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698