diff --git a/include/rcp.h b/include/rcp.h index bcb3806..fabca09 100644 --- a/include/rcp.h +++ b/include/rcp.h @@ -20,12 +20,12 @@ namespace rcp_internal virtual ~root() = default; public: - void add_ref() const + void rcp_inc() const { ref_count.fetch_add(1, std::memory_order_relaxed); } - void release_ref() const + void rcp_dec() const { if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 0) { @@ -67,7 +67,7 @@ private: { if (p) { - ptr->add_ref(); + ptr->rcp_inc(); } } @@ -80,7 +80,7 @@ public: { if (ptr) { - ptr->add_ref(); + ptr->rcp_inc(); } } @@ -88,7 +88,7 @@ public: { if (ptr) { - ptr->release_ref(); + ptr->rcp_dec(); } } @@ -98,7 +98,7 @@ public: { if (ptr) { - ptr->add_ref(); + ptr->rcp_inc(); } }