summaryrefslogtreecommitdiff
path: root/indra/llcommon/llrefcount.h
diff options
context:
space:
mode:
authorGeenz <geenz@geenzo.com>2013-05-13 22:22:51 -0400
committerGeenz <geenz@geenzo.com>2013-05-13 22:22:51 -0400
commit3779e51bfc2010877960d11b463c7316514bf991 (patch)
treeab528a6e7f78f136f9d0f0f7e939264897a44ae1 /indra/llcommon/llrefcount.h
parentb27899ee0e035ebd4072a5e6162678f2afe81053 (diff)
parent4dd245055f3417d8f8fb611a198ed5671dbce292 (diff)
Merged with https://bitbucket.org/lindenlab/viewer-beta
Diffstat (limited to 'indra/llcommon/llrefcount.h')
-rwxr-xr-x[-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..100755
--- 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