From df11c4d378ebe11ba4864d5a28559b8cb4af98c4 Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Mon, 3 Jan 2011 14:19:01 -0800 Subject: uhd: some tweaks to buffer pool --- host/lib/transport/buffer_pool.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'host/lib/transport/buffer_pool.cpp') diff --git a/host/lib/transport/buffer_pool.cpp b/host/lib/transport/buffer_pool.cpp index 9a9ddfedf..88ecedd2f 100644 --- a/host/lib/transport/buffer_pool.cpp +++ b/host/lib/transport/buffer_pool.cpp @@ -32,7 +32,7 @@ static size_t pad_to_boundary(const size_t bytes, const size_t alignment){ class buffer_pool_impl : public buffer_pool{ public: buffer_pool_impl( - const std::vector &ptrs, + const std::vector &ptrs, boost::shared_array mem ): _ptrs(ptrs), _mem(mem){ /* NOP */ @@ -47,7 +47,7 @@ public: } private: - std::vector _ptrs; + std::vector _ptrs; boost::shared_array _mem; }; @@ -63,7 +63,7 @@ buffer_pool::sptr buffer_pool::make( //2) pad the overall memory size for room after alignment //3) allocate the memory in one block of sufficient size const size_t padded_buff_size = pad_to_boundary(buff_size, alignment); - boost::shared_array mem(new char[padded_buff_size*num_buffs + alignment]); + boost::shared_array mem(new char[padded_buff_size*num_buffs + alignment-1]); //Fill a vector with boundary-aligned points in the memory const size_t mem_start = pad_to_boundary(size_t(mem.get()), alignment); -- cgit v1.2.3