1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 12:37:44 +00:00

AK: Always inline the RefCountedBase functions

This commit is contained in:
Andreas Kling 2021-10-08 22:11:39 +02:00
parent 2495460f6e
commit 77f72c7cfe

View file

@ -50,7 +50,7 @@ public:
using RefCountType = unsigned int; using RefCountType = unsigned int;
using AllowOwnPtr = FalseType; using AllowOwnPtr = FalseType;
void ref() const ALWAYS_INLINE void ref() const
{ {
VERIFY(m_ref_count > 0); VERIFY(m_ref_count > 0);
VERIFY(!Checked<RefCountType>::addition_would_overflow(m_ref_count, 1)); VERIFY(!Checked<RefCountType>::addition_would_overflow(m_ref_count, 1));
@ -71,7 +71,7 @@ protected:
RefCountedBase() = default; RefCountedBase() = default;
~RefCountedBase() { VERIFY(!m_ref_count); } ~RefCountedBase() { VERIFY(!m_ref_count); }
RefCountType deref_base() const ALWAYS_INLINE RefCountType deref_base() const
{ {
VERIFY(m_ref_count); VERIFY(m_ref_count);
return --m_ref_count; return --m_ref_count;