From 41013381d69f952f78b85de3ce226c1499d889b6 Mon Sep 17 00:00:00 2001 From: Fernando Sahmkow Date: Wed, 26 Feb 2020 17:34:23 -0400 Subject: Common/Fiber: Additional corrections to f_context. --- src/common/fiber.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index 3ef820c62..e4ecc73df 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp @@ -81,7 +81,7 @@ std::shared_ptr Fiber::ThreadToFiber() { } #else -constexpr std::size_t default_stack_size = 1024 * 1024; // 4MB +constexpr std::size_t default_stack_size = 1024 * 1024; // 1MB struct Fiber::FiberImpl { alignas(64) std::array stack; @@ -106,10 +106,10 @@ Fiber::Fiber(std::function&& entry_point_func, void* start_paramete : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, previous_fiber{} { impl = std::make_unique(); - void* stack_start = - static_cast(static_cast(impl->stack.data()) + default_stack_size); + u8* stack_limit = impl->stack.data(); + u8* stack_base = stack_limit + default_stack_size; impl->context = - boost::context::detail::make_fcontext(stack_start, impl->stack.size(), FiberStartFunc); + boost::context::detail::make_fcontext(stack_base, impl->stack.size(), FiberStartFunc); } Fiber::Fiber() { -- cgit v1.2.3