diff options
author | Josh Blum | 2013-04-16 22:19:42 -0700 |
---|---|---|
committer | Josh Blum | 2013-04-16 22:19:42 -0700 |
commit | a832d3ba9ecd417be473257d47401f0719c1b23b (patch) | |
tree | d89aeef593a73835a14c351e59800ee25a3b8aed /lib/gras_impl | |
parent | 92354bdf21ca30fabbfc6e02133581f627827296 (diff) | |
download | sandhi-a832d3ba9ecd417be473257d47401f0719c1b23b.tar.gz sandhi-a832d3ba9ecd417be473257d47401f0719c1b23b.tar.bz2 sandhi-a832d3ba9ecd417be473257d47401f0719c1b23b.zip |
gras: enable half consumed metric on pool buffers
Diffstat (limited to 'lib/gras_impl')
-rw-r--r-- | lib/gras_impl/input_buffer_queues.hpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp index 7bdbddc..e45bc06 100644 --- a/lib/gras_impl/input_buffer_queues.hpp +++ b/lib/gras_impl/input_buffer_queues.hpp @@ -282,6 +282,7 @@ GRAS_FORCE_INLINE void InputBufferQueues::push(const size_t i, const SBuffer &bu __update(i); #ifdef GRAS_ENABLE_BUFFER_STITCHING + if (_queues[i].size() <= 1) return; //stitch: for (size_t j = _queues[i].size()-1; j > 0; j--) { @@ -298,6 +299,15 @@ GRAS_FORCE_INLINE void InputBufferQueues::push(const size_t i, const SBuffer &bu b1.last = b0.get(b0.length); } } + + //back got fully stitched and it was the same buffer -> pop it + SBuffer &b1 = _queues[i].back(); + SBuffer &b0 = _queues[i][_queues[i].size()-2]; + if (b1 == b0 and b1.length == 0) + { + b1.reset(); + _queues[i].pop_back(); + } #endif //GRAS_ENABLE_BUFFER_STITCHING } |