diff options
author | Josh Blum | 2012-11-11 00:03:16 -0800 |
---|---|---|
committer | Josh Blum | 2012-11-11 00:03:16 -0800 |
commit | 284205f5fb4e27583760785aabe97e865450689a (patch) | |
tree | bc58acbe7d32dd3c259bca4613bf1607feefc0f4 /lib/gras_impl/input_buffer_queues.hpp | |
parent | 6f92f2e145b4cc88b91613c170409ee1b6a27a67 (diff) | |
download | sandhi-284205f5fb4e27583760785aabe97e865450689a.tar.gz sandhi-284205f5fb4e27583760785aabe97e865450689a.tar.bz2 sandhi-284205f5fb4e27583760785aabe97e865450689a.zip |
fixed input fail logic w/ input_queues.is_front_maximal
Diffstat (limited to 'lib/gras_impl/input_buffer_queues.hpp')
-rw-r--r-- | lib/gras_impl/input_buffer_queues.hpp | 11 |
1 files changed, 8 insertions, 3 deletions
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 @@ -51,10 +51,14 @@ struct InputBufferQueues */ 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 |