diff options
author | Josh Blum <josh@joshknows.com> | 2011-05-16 12:08:23 -0700 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-05-16 12:08:23 -0700 |
commit | 22097e81dc54c895ed411c74c1829721e3a1ce5e (patch) | |
tree | 8cc9ca6d8bb0432b9562fc19636eca3421b21100 /host/lib/transport | |
parent | 13be023531fa1be8d43b999c3ea5ab477f101fdc (diff) | |
parent | ea5ce50a465e714c63196f52df97fb3e927e701c (diff) | |
download | uhd-22097e81dc54c895ed411c74c1829721e3a1ce5e.tar.gz uhd-22097e81dc54c895ed411c74c1829721e3a1ce5e.tar.bz2 uhd-22097e81dc54c895ed411c74c1829721e3a1ce5e.zip |
Merge branch 'master' into release_work
Diffstat (limited to 'host/lib/transport')
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 12 | ||||
-rw-r--r-- | host/lib/transport/udp_zero_copy.cpp | 12 |
2 files changed, 4 insertions, 20 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index d4cfab422..28bea978b 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -73,14 +73,10 @@ public: sptr get_new(void){ _expired = false; - return sptr(this, &libusb_zero_copy_mrb::fake_deleter); + return make_managed_buffer(this); } private: - static void fake_deleter(void *obj){ - static_cast<libusb_zero_copy_mrb *>(obj)->release(); - } - const void *get_buff(void) const{return _lut->buffer;} size_t get_size(void) const{return _lut->actual_length;} @@ -108,14 +104,10 @@ public: sptr get_new(void){ _expired = false; - return sptr(this, &libusb_zero_copy_msb::fake_deleter); + return make_managed_buffer(this); } private: - static void fake_deleter(void *obj){ - static_cast<libusb_zero_copy_msb *>(obj)->commit(0); - } - void *get_buff(void) const{return _lut->buffer;} size_t get_size(void) const{return _lut->length;} 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;} |