diff options
author | eb <eb@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-07-15 01:33:49 +0000 |
---|---|---|
committer | eb <eb@221aa14e-8319-0410-a670-987f0aec2ac5> | 2009-07-15 01:33:49 +0000 |
commit | 134b8933fd898fbd6462d1c3c0175e1f8157a27f (patch) | |
tree | a74050e1562ef98f2f1f52147d4cdc409b433f27 /pmt/src/lib/pmt_int.h | |
parent | fe781ab6591ad46b6ebb7ce425fc225c49461e70 (diff) |
pmt performance improvement: Switch from shared_ptr to intrusive_ptr
for pmt_t (c1258 from Stefan BrĂ¼ns).
git-svn-id: http://gnuradio.org/svn/gnuradio/trunk@11442 221aa14e-8319-0410-a670-987f0aec2ac5
Diffstat (limited to 'pmt/src/lib/pmt_int.h')
-rw-r--r-- | pmt/src/lib/pmt_int.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/pmt/src/lib/pmt_int.h b/pmt/src/lib/pmt_int.h index a973d30d9e..af22d45159 100644 --- a/pmt/src/lib/pmt_int.h +++ b/pmt/src/lib/pmt_int.h @@ -34,8 +34,10 @@ #define PMT_LOCAL_ALLOCATOR 0 // define to 0 or 1 class pmt_base : boost::noncopyable { + mutable boost::detail::atomic_count count_; + protected: - pmt_base(){}; + pmt_base() : count_(0) {}; virtual ~pmt_base(); public: @@ -65,6 +67,9 @@ public: virtual bool is_c32vector() const { return false; } virtual bool is_c64vector() const { return false; } + friend void intrusive_ptr_add_ref(pmt_base* p); + friend void intrusive_ptr_release(pmt_base* p); + # if (PMT_LOCAL_ALLOCATOR) void *operator new(size_t); void operator delete(void *, size_t); |