summaryrefslogtreecommitdiff
path: root/indra/llcommon/llrefcount.h
diff options
context:
space:
mode:
authorOz Linden <oz@lindenlab.com>2013-03-08 10:10:59 -0500
committerOz Linden <oz@lindenlab.com>2013-03-08 10:10:59 -0500
commita7f02a3e51f07c657a0acd31637f46f74b30daf7 (patch)
treec572c162ee7bec027971ca7a64f74032938b20a8 /indra/llcommon/llrefcount.h
parentcce59647a99648af63c96168c36e85563da40a1a (diff)
parent55b2383f51ffabf7e95595df5d576f383d458ee1 (diff)
merge changes for 3.5.0-beta2
Diffstat (limited to 'indra/llcommon/llrefcount.h')
-rw-r--r--indra/llcommon/llrefcount.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/indra/llcommon/llrefcount.h b/indra/llcommon/llrefcount.h
index 8eb5d53f3f..32ae15435a 100644
--- a/indra/llcommon/llrefcount.h
+++ b/indra/llcommon/llrefcount.h
@@ -27,6 +27,7 @@
#define LLREFCOUNT_H
#include <boost/noncopyable.hpp>
+#include <boost/intrusive_ptr.hpp>
#define LL_REF_COUNT_DEBUG 0
#if LL_REF_COUNT_DEBUG
@@ -86,4 +87,22 @@ private:
#endif
};
+/**
+ * intrusive pointer support
+ * this allows you to use boost::intrusive_ptr with any LLRefCount-derived type
+ */
+namespace boost
+{
+ inline void intrusive_ptr_add_ref(LLRefCount* p)
+ {
+ p->ref();
+ }
+
+ inline void intrusive_ptr_release(LLRefCount* p)
+ {
+ p->unref();
+ }
+};
+
+
#endif