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

Side by Side Diff: include/private/SkAtomics.h

Issue 2183473005: Clean up some unused atomic routines. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: Created 4 years, 4 months 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 | « bench/RefCntBench.cpp ('k') | tests/AtomicTest.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 /* 1 /*
2 * Copyright 2015 Google Inc. 2 * Copyright 2015 Google Inc.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license that can be 4 * Use of this source code is governed by a BSD-style license that can be
5 * found in the LICENSE file. 5 * found in the LICENSE file.
6 */ 6 */
7 7
8 #ifndef SkAtomics_DEFINED 8 #ifndef SkAtomics_DEFINED
9 #define SkAtomics_DEFINED 9 #define SkAtomics_DEFINED
10 10
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after
146 std::atomic<T>* ap = reinterpret_cast<std::atomic<T>*>(ptr); 146 std::atomic<T>* ap = reinterpret_cast<std::atomic<T>*>(ptr);
147 return std::atomic_exchange_explicit(ap, val, (std::memory_order)mo); 147 return std::atomic_exchange_explicit(ap, val, (std::memory_order)mo);
148 } 148 }
149 149
150 // ~~~~~~~~ Legacy APIs ~~~~~~~~~ 150 // ~~~~~~~~ Legacy APIs ~~~~~~~~~
151 151
152 // From here down we have shims for our old atomics API, to be weaned off of. 152 // From here down we have shims for our old atomics API, to be weaned off of.
153 // We use the default sequentially-consistent memory order to make things simple 153 // We use the default sequentially-consistent memory order to make things simple
154 // and to match the practical reality of our old _sync and _win implementations. 154 // and to match the practical reality of our old _sync and _win implementations.
155 155
156 inline int32_t sk_atomic_inc(int32_t* ptr) { return sk_atomic_fetch_a dd(ptr, +1); } 156 inline int32_t sk_atomic_inc(int32_t* ptr) { return sk_atomic_fetch_add(ptr, +1) ; }
157 inline int32_t sk_atomic_dec(int32_t* ptr) { return sk_atomic_fetch_a dd(ptr, -1); } 157 inline int32_t sk_atomic_dec(int32_t* ptr) { return sk_atomic_fetch_add(ptr, -1) ; }
158 inline int32_t sk_atomic_add(int32_t* ptr, int32_t v) { return sk_atomic_fetch_a dd(ptr, v); }
159
160 inline int64_t sk_atomic_inc(int64_t* ptr) { return sk_atomic_fetch_add<int64_t> (ptr, +1); }
161 158
162 #endif//SkAtomics_DEFINED 159 #endif//SkAtomics_DEFINED
OLDNEW
« no previous file with comments | « bench/RefCntBench.cpp ('k') | tests/AtomicTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698