diff options
author | Josh Blum <josh@joshknows.com> | 2011-01-04 16:50:18 -0800 |
---|---|---|
committer | Josh Blum <josh@joshknows.com> | 2011-01-04 16:50:18 -0800 |
commit | 78085d3c101e0dbaf95393904c8c06ca5279cc42 (patch) | |
tree | 10372369d97f5c7baef0c35c2dd1558444ed8496 /host/lib/transport/libusb1_zero_copy.cpp | |
parent | fabfa8d9dd6670afb9c621b9ee12f8d602d7ccda (diff) | |
parent | df11c4d378ebe11ba4864d5a28559b8cb4af98c4 (diff) | |
download | uhd-78085d3c101e0dbaf95393904c8c06ca5279cc42.tar.gz uhd-78085d3c101e0dbaf95393904c8c06ca5279cc42.tar.bz2 uhd-78085d3c101e0dbaf95393904c8c06ca5279cc42.zip |
Merge branch 'buffer_pool' into next
Diffstat (limited to 'host/lib/transport/libusb1_zero_copy.cpp')
-rw-r--r-- | host/lib/transport/libusb1_zero_copy.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/host/lib/transport/libusb1_zero_copy.cpp b/host/lib/transport/libusb1_zero_copy.cpp index f589d7c77..5dc230527 100644 --- a/host/lib/transport/libusb1_zero_copy.cpp +++ b/host/lib/transport/libusb1_zero_copy.cpp @@ -18,9 +18,9 @@ #include "libusb1_base.hpp" #include <uhd/transport/usb_zero_copy.hpp> #include <uhd/transport/bounded_buffer.hpp> +#include <uhd/transport/buffer_pool.hpp> #include <uhd/utils/thread_priority.hpp> #include <uhd/utils/assert.hpp> -#include <boost/shared_array.hpp> #include <boost/foreach.hpp> #include <boost/thread.hpp> #include <boost/enable_shared_from_this.hpp> @@ -105,8 +105,8 @@ private: //! a list of all transfer structs we allocated std::vector<libusb_transfer *> _all_luts; - //! a block of memory for the transfer buffers - boost::shared_array<char> _buffer; + //! memory allocated for the transfer buffers + buffer_pool::sptr _buffer_pool; // Calls for processing asynchronous I/O libusb_transfer *allocate_transfer(void *mem, size_t len); @@ -157,9 +157,9 @@ usb_endpoint::usb_endpoint( _input(input) { _completed_list = lut_buff_type::make(num_transfers); - _buffer = boost::shared_array<char>(new char[num_transfers*transfer_size]); + _buffer_pool = buffer_pool::make(num_transfers, transfer_size); for (size_t i = 0; i < num_transfers; i++){ - _all_luts.push_back(allocate_transfer(_buffer.get() + i*transfer_size, transfer_size)); + _all_luts.push_back(allocate_transfer(_buffer_pool->at(i), transfer_size)); //input luts are immediately submitted to be filled //output luts go into the completed list as free buffers |