From 284205f5fb4e27583760785aabe97e865450689a Mon Sep 17 00:00:00 2001 From: Josh Blum Date: Sun, 11 Nov 2012 00:03:16 -0800 Subject: fixed input fail logic w/ input_queues.is_front_maximal --- lib/gras_impl/input_buffer_queues.hpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'lib/gras_impl/input_buffer_queues.hpp') diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp index d216cbe..c0148a8 100644 --- a/lib/gras_impl/input_buffer_queues.hpp +++ b/lib/gras_impl/input_buffer_queues.hpp @@ -50,11 +50,15 @@ struct InputBufferQueues * or the first buffer is larger than we can accumulate. */ GRAS_FORCE_INLINE bool is_accumulated(const size_t i) const + { + return (_queues[i].size() <= 1) or this->is_front_maximal(i); + } + + //! Return true if the front buffer is at least max size + GRAS_FORCE_INLINE bool is_front_maximal(const size_t i) const { ASSERT(not _queues[i].empty()); - return - (_queues[i].front().length == _enqueued_bytes[i]) or - (_queues[i].front().length >= _maximum_bytes[i]); + return _queues[i].front().length >= _maximum_bytes[i]; } GRAS_FORCE_INLINE void push(const size_t i, const SBuffer &buffer) @@ -135,6 +139,7 @@ inline void InputBufferQueues::update_config( { //first allocate the aux buffer if (maximum_bytes != 0) _maximum_bytes[i] = maximum_bytes; + _maximum_bytes[i] = std::max(_maximum_bytes[i], reserve_bytes); if ( not _aux_queues[i] or _aux_queues[i]->empty() or -- cgit