Rename ref_count to rcp_ref_count
This commit is contained in:
1 parent
27420c507d
commit
3a624ee65b
1 file changed
+4
-4
+4
-4
@@ -276,21 +276,21 @@ rcp<T> rcp_dynamic_cast(rcp<U> && other)
|
||||
|
||||
#define rcp_managed_root(classname) \
|
||||
private: \
|
||||
mutable std::atomic<int> ref_count{0}; \
|
||||
mutable std::atomic<int> rcp_ref_count{0}; \
|
||||
void rcp_inc() const \
|
||||
{ \
|
||||
ref_count.fetch_add(1, std::memory_order_relaxed); \
|
||||
rcp_ref_count.fetch_add(1, std::memory_order_relaxed); \
|
||||
} \
|
||||
void rcp_dec() const \
|
||||
{ \
|
||||
if (ref_count.fetch_sub(1, std::memory_order_acq_rel) == 1) \
|
||||
if (rcp_ref_count.fetch_sub(1, std::memory_order_acq_rel) == 1) \
|
||||
{ \
|
||||
delete this; \
|
||||
} \
|
||||
} \
|
||||
int rcp_count() const \
|
||||
{ \
|
||||
return ref_count.load(std::memory_order_relaxed); \
|
||||
return rcp_ref_count.load(std::memory_order_relaxed); \
|
||||
} \
|
||||
template <typename T> friend class rcp; \
|
||||
rcp_managed(classname)
|
||||
|
||||
Reference in new issue
Block a user