summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/block_allocator.cpp4
-rw-r--r--lib/input_handlers.cpp9
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/block_allocator.cpp b/lib/block_allocator.cpp
index 3168bc2..8246037 100644
--- a/lib/block_allocator.cpp
+++ b/lib/block_allocator.cpp
@@ -81,10 +81,6 @@ void BlockActor::handle_top_alloc(const TopAllocMessage &, const Theron::Address
data->output_queues.set_buffer_queue(i, queue);
InputAllocMessage message;
- //new token for the downstream allocator
- //so when the downstream overrides, old token gets reset
- token = SBufferToken(new SBufferDeleter(deleter));
- config.token = token;
message.config = config;
message.token = token;
worker->post_downstream(i, message);
diff --git a/lib/input_handlers.cpp b/lib/input_handlers.cpp
index 3027257..3c985ce 100644
--- a/lib/input_handlers.cpp
+++ b/lib/input_handlers.cpp
@@ -93,9 +93,16 @@ void BlockActor::handle_input_alloc(const InputAllocMessage &message, const Ther
MESSAGE_TRACER();
const size_t index = message.index;
+ //new token for this downstream allocator
+ //so if the downstream overrides, it has a unique token
+ SBufferDeleter deleter = *(message.token);
+ SBufferToken token = SBufferToken(new SBufferDeleter(deleter));
+ SBufferConfig config = message.config;
+ config.token = token;
+
//handle the upstream block allocation request
OutputAllocMessage new_msg;
- new_msg.queue = data->block->input_buffer_allocator(index, message.config);
+ new_msg.queue = data->block->input_buffer_allocator(index, config);
if (new_msg.queue) worker->post_upstream(index, new_msg);
}