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

Side by Side Diff: include/core/SkDynamicAnnotations.h

Issue 702883002: Whitelist intentionally racy TRACE_EVENT reads and writes. (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: this volatile makes no sense. Created 6 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 | « no previous file | src/core/SkTraceEvent.h » ('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 2014 Google Inc. 2 * Copyright 2014 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 SkDynamicAnnotations_DEFINED 8 #ifndef SkDynamicAnnotations_DEFINED
9 #define SkDynamicAnnotations_DEFINED 9 #define SkDynamicAnnotations_DEFINED
10 10
(...skipping 24 matching lines...) Expand all
35 template <typename T> 35 template <typename T>
36 inline T SK_ANNOTATE_UNPROTECTED_READ(const volatile T& x) { 36 inline T SK_ANNOTATE_UNPROTECTED_READ(const volatile T& x) {
37 AnnotateIgnoreReadsBegin(__FILE__, __LINE__); 37 AnnotateIgnoreReadsBegin(__FILE__, __LINE__);
38 T read = x; 38 T read = x;
39 AnnotateIgnoreReadsEnd(__FILE__, __LINE__); 39 AnnotateIgnoreReadsEnd(__FILE__, __LINE__);
40 return read; 40 return read;
41 } 41 }
42 42
43 // Like SK_ANNOTATE_UNPROTECTED_READ, but for writes. 43 // Like SK_ANNOTATE_UNPROTECTED_READ, but for writes.
44 template <typename T> 44 template <typename T>
45 inline void SK_ANNOTATE_UNPROTECTED_WRITE(T* ptr, const volatile T& val) { 45 inline void SK_ANNOTATE_UNPROTECTED_WRITE(T* ptr, const T& val) {
46 AnnotateIgnoreWritesBegin(__FILE__, __LINE__); 46 AnnotateIgnoreWritesBegin(__FILE__, __LINE__);
47 *ptr = val; 47 *ptr = val;
48 AnnotateIgnoreWritesEnd(__FILE__, __LINE__); 48 AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
49 } 49 }
50 50
51 // Ignore racy reads and racy writes to this pointer, indefinitely. 51 // Ignore racy reads and racy writes to this pointer, indefinitely.
52 // If at all possible, use the more precise SK_ANNOTATE_UNPROTECTED_READ. 52 // If at all possible, use the more precise SK_ANNOTATE_UNPROTECTED_READ.
53 template <typename T> 53 template <typename T>
54 void SK_ANNOTATE_BENIGN_RACE(T* ptr) { 54 void SK_ANNOTATE_BENIGN_RACE(T* ptr) {
55 AnnotateBenignRaceSized(__FILE__, __LINE__, ptr, sizeof(*ptr), "SK_ANNOTATE_ BENIGN_RACE"); 55 AnnotateBenignRaceSized(__FILE__, __LINE__, ptr, sizeof(*ptr), "SK_ANNOTATE_ BENIGN_RACE");
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
104 T* get() { return &fVal; } 104 T* get() { return &fVal; }
105 105
106 const T* operator->() const { return &fVal; } 106 const T* operator->() const { return &fVal; }
107 T* operator->() { return &fVal; } 107 T* operator->() { return &fVal; }
108 108
109 private: 109 private:
110 T fVal; 110 T fVal;
111 }; 111 };
112 112
113 #endif//SkDynamicAnnotations_DEFINED 113 #endif//SkDynamicAnnotations_DEFINED
OLDNEW
« no previous file with comments | « no previous file | src/core/SkTraceEvent.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698