diff options
| author | Josh Blum <josh@joshknows.com> | 2011-01-03 14:19:01 -0800 | 
|---|---|---|
| committer | Josh Blum <josh@joshknows.com> | 2011-01-03 14:19:01 -0800 | 
| commit | df11c4d378ebe11ba4864d5a28559b8cb4af98c4 (patch) | |
| tree | 596733e8cfaf14d9508e913ef8c8943c93b64bcd | |
| parent | ed6a2941f8e144e5f02a7a34c9d4764c65174617 (diff) | |
| download | uhd-df11c4d378ebe11ba4864d5a28559b8cb4af98c4.tar.gz uhd-df11c4d378ebe11ba4864d5a28559b8cb4af98c4.tar.bz2 uhd-df11c4d378ebe11ba4864d5a28559b8cb4af98c4.zip | |
uhd: some tweaks to buffer pool
| -rw-r--r-- | host/lib/transport/buffer_pool.cpp | 6 | 
1 files changed, 3 insertions, 3 deletions
| 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<buffer_pool::ptr_type> &ptrs, +        const std::vector<ptr_type> &ptrs,          boost::shared_array<char> mem      ): _ptrs(ptrs), _mem(mem){          /* NOP */ @@ -47,7 +47,7 @@ public:      }  private: -    std::vector<void *> _ptrs; +    std::vector<ptr_type> _ptrs;      boost::shared_array<char> _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<char> mem(new char[padded_buff_size*num_buffs + alignment]); +    boost::shared_array<char> 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); | 
