From 46f37a6050e02a958d1cafbd7da42500df88e458 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Tue, 24 Feb 2015 13:43:37 +0000 Subject: [PATCH] Always inline RefPtr::{acquire,release,moved} --- src/ref_ptr.hh | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/ref_ptr.hh b/src/ref_ptr.hh index 792e765c..07f43fbb 100644 --- a/src/ref_ptr.hh +++ b/src/ref_ptr.hh @@ -60,12 +60,14 @@ struct RefPtr private: T* m_ptr = nullptr; + [[gnu::always_inline]] void acquire() { if (m_ptr) inc_ref_count(static_cast(m_ptr), this); } + [[gnu::always_inline]] void release() { if (m_ptr) @@ -73,6 +75,7 @@ private: m_ptr = nullptr; } + [[gnu::always_inline]] void moved(void* from) noexcept(noexcept(ref_ptr_moved(static_cast(nullptr), nullptr, nullptr))) {