aboutsummaryrefslogtreecommitdiffstats
path: root/host/lib/transport/udp_zero_copy.cpp
diff options
context:
space:
mode:
authorJosh Blum <josh@joshknows.com>2011-05-14 17:11:05 -0700
committerJosh Blum <josh@joshknows.com>2011-05-14 20:28:20 -0700
commitea5ce50a465e714c63196f52df97fb3e927e701c (patch)
treed69b081995d483ebb43d0971e48e401cd35c1a53 /host/lib/transport/udp_zero_copy.cpp
parent4b772ff4f3b1e388e150402beaf6567f3ea29e1c (diff)
downloaduhd-ea5ce50a465e714c63196f52df97fb3e927e701c.tar.gz
uhd-ea5ce50a465e714c63196f52df97fb3e927e701c.tar.bz2
uhd-ea5ce50a465e714c63196f52df97fb3e927e701c.zip
uhd: replace managed buffer shared pointer w/ intrusive pointer to reduce overhead
Diffstat (limited to 'host/lib/transport/udp_zero_copy.cpp')
-rw-r--r--host/lib/transport/udp_zero_copy.cpp12
1 files changed, 2 insertions, 10 deletions
diff --git a/host/lib/transport/udp_zero_copy.cpp b/host/lib/transport/udp_zero_copy.cpp
index c3ba085bf..8c97e1e99 100644
--- a/host/lib/transport/udp_zero_copy.cpp
+++ b/host/lib/transport/udp_zero_copy.cpp
@@ -52,16 +52,12 @@ public:
sptr get_new(size_t len){
_len = len;
- return sptr(this, &udp_zero_copy_asio_mrb::fake_deleter);
+ return make_managed_buffer(this);
}
template <class T> T cast(void) const{return static_cast<T>(_mem);}
private:
- static void fake_deleter(void *obj){
- static_cast<udp_zero_copy_asio_mrb *>(obj)->release();
- }
-
const void *get_buff(void) const{return _mem;}
size_t get_size(void) const{return _len;}
@@ -90,14 +86,10 @@ public:
sptr get_new(size_t len){
_len = len;
- return sptr(this, &udp_zero_copy_asio_msb::fake_deleter);
+ return make_managed_buffer(this);
}
private:
- static void fake_deleter(void *obj){
- static_cast<udp_zero_copy_asio_msb *>(obj)->commit(0);
- }
-
void *get_buff(void) const{return _mem;}
size_t get_size(void) const{return _len;}