From 2cb2961c9f6062e867b6ccc3d9067f55c7b81ea4 Mon Sep 17 00:00:00 2001 From: Pixel Date: Thu, 17 Nov 2011 11:17:57 -0800 Subject: Cleaning some code, redesigning a bit the stack allocation problem from the task manager, and actually implementing it properly. --- src/Task.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/Task.cc') diff --git a/src/Task.cc b/src/Task.cc index d72decc..440ed0e 100644 --- a/src/Task.cc +++ b/src/Task.cc @@ -21,12 +21,14 @@ bool Balau::Task::needsStacks() { #endif } -void Balau::Task::setup(TaskMan * taskMan) { +void Balau::Task::setup(TaskMan * taskMan, void * stack) { size_t size = stackSize(); #ifndef _WIN32 - m_stack = taskMan->getStack(); + Assert(stack); + m_stack = stack; coro_create(&m_ctx, coroutineTrampoline, this, m_stack, size); #else + Assert(!stack); m_stack = NULL; m_fiber = CreateFiber(size, coroutineTrampoline, this); #endif -- cgit v1.2.3