aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--include/core/SkRefCnt.h36
1 files changed, 0 insertions, 36 deletions
diff --git a/include/core/SkRefCnt.h b/include/core/SkRefCnt.h
index adebd9b8a6..bc6ccd8dff 100644
--- a/include/core/SkRefCnt.h
+++ b/include/core/SkRefCnt.h
@@ -138,42 +138,6 @@ class SK_API SkRefCnt : public SkRefCntBase {
///////////////////////////////////////////////////////////////////////////////
-/** Helper macro to safely assign one SkRefCnt[TS]* to another, checking for
- null in on each side of the assignment, and ensuring that ref() is called
- before unref(), in case the two pointers point to the same object.
- */
-
-#if defined(SK_BUILD_FOR_ANDROID_FRAMEWORK)
-// This version heuristically detects data races, since those otherwise result
-// in redundant reference count decrements, which are exceedingly
-// difficult to debug.
-
-#define SkRefCnt_SafeAssign(dst, src) \
- do { \
- typedef typename std::remove_reference<decltype(dst)>::type \
- SkRefCntPtrT; \
- SkRefCntPtrT old_dst = *const_cast<SkRefCntPtrT volatile *>(&dst); \
- if (src) src->ref(); \
- if (old_dst) old_dst->unref(); \
- if (old_dst != *const_cast<SkRefCntPtrT volatile *>(&dst)) { \
- SkDebugf("Detected racing Skia calls at %s:%d\n", \
- __FILE__, __LINE__); \
- } \
- dst = src; \
- } while (0)
-
-#else /* !SK_BUILD_FOR_ANDROID_FRAMEWORK */
-
-#define SkRefCnt_SafeAssign(dst, src) \
- do { \
- if (src) src->ref(); \
- if (dst) dst->unref(); \
- dst = src; \
- } while (0)
-
-#endif
-
-
/** Call obj->ref() and return obj. The obj must not be nullptr.
*/
template <typename T> static inline T* SkRef(T* obj) {