Return whether the reference count is zero. With conventional object referencing counting, the object will be destroyed, so the reference count should never be zero. Hence this is generally used for a debug check.
| 105 | // referencing counting, the object will be destroyed, so the reference count |
| 106 | // should never be zero. Hence this is generally used for a debug check. |
| 107 | inline bool RefCountIsZero(const volatile Atomic32 *ptr) { |
| 108 | bool res = (subtle::Acquire_Load(ptr) == 0); |
| 109 | if (res) { |
| 110 | ANNOTATE_HAPPENS_AFTER(ptr); |
| 111 | } |
| 112 | return res; |
| 113 | } |
| 114 | |
| 115 | #if BASE_HAS_ATOMIC64 |
| 116 | // Implementations for Atomic64, if available. |