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

Unified Diff: include/core/SkDynamicAnnotations.h

Issue 955803002: SkTRacy<T> -> SkAtomic<T> (Closed) Base URL: https://skia.googlesource.com/skia.git@master
Patch Set: great warning Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: include/core/SkDynamicAnnotations.h
diff --git a/include/core/SkDynamicAnnotations.h b/include/core/SkDynamicAnnotations.h
index e7710307f5532589a09b1f56d9b976cfdc373de7..86b01814a8f38ba005c0ac6105150c492573a87a 100644
--- a/include/core/SkDynamicAnnotations.h
+++ b/include/core/SkDynamicAnnotations.h
@@ -23,8 +23,6 @@ void AnnotateIgnoreReadsBegin(const char* file, int line);
void AnnotateIgnoreReadsEnd(const char* file, int line);
void AnnotateIgnoreWritesBegin(const char* file, int line);
void AnnotateIgnoreWritesEnd(const char* file, int line);
-void AnnotateBenignRaceSized(const char* file, int line,
- const volatile void* addr, long size, const char* desc);
} // extern "C"
// SK_ANNOTATE_UNPROTECTED_READ can wrap any variable read to tell TSAN to ignore that it appears to
@@ -51,38 +49,11 @@ inline void SK_ANNOTATE_UNPROTECTED_WRITE(T* ptr, const T& val) {
AnnotateIgnoreWritesEnd(__FILE__, __LINE__);
}
-// Ignore racy reads and racy writes to this pointer, indefinitely.
-// If at all possible, use the more precise SK_ANNOTATE_UNPROTECTED_READ.
-template <typename T>
-void SK_ANNOTATE_BENIGN_RACE(T* ptr) {
- AnnotateBenignRaceSized(__FILE__, __LINE__, ptr, sizeof(*ptr), "SK_ANNOTATE_BENIGN_RACE");
-}
-
#else // !DYNAMIC_ANNOTATIONS_ENABLED
#define SK_ANNOTATE_UNPROTECTED_READ(x) (x)
#define SK_ANNOTATE_UNPROTECTED_WRITE(ptr, val) *(ptr) = (val)
-#define SK_ANNOTATE_BENIGN_RACE(ptr)
#endif
-// Can be used to wrap values that are intentionally racy, usually small mutable cached values, e.g.
-// - SkMatrix type mask
-// - SkPixelRef genIDs
-template <typename T>
-class SkTRacy {
-public:
- operator const T() const {
- return SK_ANNOTATE_UNPROTECTED_READ(fVal);
- }
-
- SkTRacy& operator=(const T& val) {
- SK_ANNOTATE_UNPROTECTED_WRITE(&fVal, val);
- return *this;
- }
-
-private:
- T fVal;
-};
-
#endif//SkDynamicAnnotations_DEFINED
« no previous file with comments | « include/core/SkAtomics.h ('k') | include/core/SkPixelRef.h » ('j') | src/core/SkPixelRef.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698