aboutsummaryrefslogtreecommitdiffstats
path: root/common/intrusive_ptr.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2023-03-01 11:35:39 -0800
committerChris Robinson <[email protected]>2023-03-01 11:35:39 -0800
commitfde74453a62a1ce4b5efaac0ec1835b9f5731e25 (patch)
treeed74db646800b78ca8651bb5291453927f48cd93 /common/intrusive_ptr.h
parentec9c421d312d6df701631877f6ce6256355101dc (diff)
Use macros for the likely/unlikely attributes
The syntax parser for GCC 8 (and earlier?) fails when these attributes are in certain places.
Diffstat (limited to 'common/intrusive_ptr.h')
-rw-r--r--common/intrusive_ptr.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/common/intrusive_ptr.h b/common/intrusive_ptr.h
index 84d18aa0..27075347 100644
--- a/common/intrusive_ptr.h
+++ b/common/intrusive_ptr.h
@@ -18,7 +18,7 @@ public:
unsigned int dec_ref() noexcept
{
auto ref = DecrementRef(mRef);
- if(ref == 0) [[unlikely]]
+ if(ref == 0) UNLIKELY
delete static_cast<T*>(this);
return ref;
}
@@ -71,7 +71,7 @@ public:
}
intrusive_ptr& operator=(intrusive_ptr&& rhs) noexcept
{
- if(&rhs != this) [[likely]]
+ if(&rhs != this) LIKELY
{
if(mPtr) mPtr->dec_ref();
mPtr = std::exchange(rhs.mPtr, nullptr);