Rename ref_count to rcp_ref_count
This commit is contained in:
parent
27420c507d
commit
3a624ee65b
@ -276,21 +276,21 @@ rcp<T> rcp_dynamic_cast(rcp<U> && other)
|
|||||||
|
|
||||||
#define rcp_managed_root(classname) \
|
#define rcp_managed_root(classname) \
|
||||||
private: \
|
private: \
|
||||||
mutable std::atomic<int> ref_count{0}; \
|
mutable std::atomic<int> rcp_ref_count{0}; \
|
||||||
void rcp_inc() const \
|
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 \
|
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; \
|
delete this; \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
int rcp_count() const \
|
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; \
|
template <typename T> friend class rcp; \
|
||||||
rcp_managed(classname)
|
rcp_managed(classname)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user