summaryrefslogtreecommitdiff
path: root/lib/block_allocator.cpp
diff options
context:
space:
mode:
authorJosh Blum2012-09-18 15:49:07 -0700
committerJosh Blum2012-09-18 15:49:07 -0700
commit4d6d5b216f86e976322fb4fed800c756fdef4315 (patch)
tree73d5ef202b503ca73d99ae1307ae527e77b7c8c7 /lib/block_allocator.cpp
parente951507b7f81d019ae0120c04554145dc0b5a257 (diff)
downloadsandhi-4d6d5b216f86e976322fb4fed800c756fdef4315.tar.gz
sandhi-4d6d5b216f86e976322fb4fed800c756fdef4315.tar.bz2
sandhi-4d6d5b216f86e976322fb4fed800c756fdef4315.zip
created hooks for input buffer allocator
Diffstat (limited to 'lib/block_allocator.cpp')
-rw-r--r--lib/block_allocator.cpp20
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/block_allocator.cpp b/lib/block_allocator.cpp
index 24369c7..ffd052b 100644
--- a/lib/block_allocator.cpp
+++ b/lib/block_allocator.cpp
@@ -86,15 +86,19 @@ void ElementImpl::handle_allocation(const tsbe::TaskInterface &task_iface)
);
SBufferDeleter deleter = boost::bind(&ElementImpl::buffer_returner, this, i, _1);
+ SBufferToken token = SBufferToken(new SBufferDeleter(deleter));
- this->output_buffer_tokens[i] = block_ptr->output_buffer_allocator(
- i, SBufferToken(new SBufferDeleter(deleter)), bytes
- );
+ this->output_buffer_tokens[i] = block_ptr->output_buffer_allocator(i, token, bytes);
+
+ InputAllocatorMessage message;
+ message.token = token;
+ message.recommend_length = bytes;
+ task_iface.post_downstream(i, message);
}
}
SBufferToken Block::output_buffer_allocator(
- const size_t which_output,
+ const size_t,
const SBufferToken &token,
const size_t recommend_length
){
@@ -110,3 +114,11 @@ SBufferToken Block::output_buffer_allocator(
}
return token;
}
+
+SBufferToken Block::input_buffer_allocator(
+ const size_t,
+ const SBufferToken &,
+ const size_t
+){
+ return SBufferToken(); //null
+}