summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Blum2012-10-12 22:21:17 -0700
committerJosh Blum2012-10-12 22:21:17 -0700
commitf9c854d3cdd0a9337b41842d15a13d6df4ece408 (patch)
tree466b1cc8e1470d7e202f1722e93196468d25fa19
parent9681d80c37794d66fd8a171efb4b047306b937d3 (diff)
downloadsandhi-f9c854d3cdd0a9337b41842d15a13d6df4ece408.tar.gz
sandhi-f9c854d3cdd0a9337b41842d15a13d6df4ece408.tar.bz2
sandhi-f9c854d3cdd0a9337b41842d15a13d6df4ece408.zip
working on qa passing, temp input accumulation logic
-rw-r--r--lib/block_task.cpp3
-rw-r--r--lib/gras_impl/input_buffer_queues.hpp25
-rw-r--r--lib/input_handlers.cpp5
3 files changed, 32 insertions, 1 deletions
diff --git a/lib/block_task.cpp b/lib/block_task.cpp
index c1046c3..66669d1 100644
--- a/lib/block_task.cpp
+++ b/lib/block_task.cpp
@@ -191,7 +191,8 @@ void BlockActor::handle_task(void)
if (work_noutput_items) goto forecast_again_you_jerk;
//handle the case of forecast failing
- this->mark_done();
+ //TODO accumulate input here, only done if inputs done and already accumulated
+ if (this->inputs_done[i]) this->mark_done();
return;
}
}
diff --git a/lib/gras_impl/input_buffer_queues.hpp b/lib/gras_impl/input_buffer_queues.hpp
index 5b610d1..a3ca1dc 100644
--- a/lib/gras_impl/input_buffer_queues.hpp
+++ b/lib/gras_impl/input_buffer_queues.hpp
@@ -212,6 +212,31 @@ GRAS_FORCE_INLINE SBuffer InputBufferQueues::front(const size_t i, const bool co
GRAS_FORCE_INLINE void InputBufferQueues::__prepare(const size_t i)
{
+ SBufferConfig config;
+ config.memory = NULL;
+ config.length = _enqueued_bytes[i];
+ SBuffer newbuff(config);
+ newbuff.offset = 0;
+ newbuff.length = 0;
+
+ while (not _queues[i].empty())
+ {
+ std::memcpy(newbuff.get(newbuff.length), _queues[i].front().get(), _queues[i].front().length);
+ newbuff.length += _queues[i].front().length;
+ _queues[i].pop_front();
+ }
+
+ _queues[i].push_back(newbuff);
+ return;
+
+
+
+
+
+
+
+
+
//HERE();
//assumes that we are always pushing proper history buffs on front
//ASSERT(_queues[i].front().length >= _history_bytes[i]);
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index 574aee4..30bb613 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -60,6 +60,11 @@ void BlockActor::handle_input_check(const InputCheckMessage &message, const Ther
{
this->mark_done();
}
+ //or re-enter handle task so forecast logic can mark done
+ else
+ {
+ this->handle_task();
+ }
}
void BlockActor::handle_input_alloc(const InputAllocMessage &message, const Theron::Address)