diff options
author | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-02-26 22:34:23 +0100 |
---|---|---|
committer | Fernando Sahmkow <fsahmkow27@gmail.com> | 2020-06-18 22:29:25 +0200 |
commit | 41013381d69f952f78b85de3ce226c1499d889b6 (patch) | |
tree | 0f1f0e06e76eaf67488b98663dffe10e296f83c3 /src/common | |
parent | Common/Fiber: Correct f_context based Fibers. (diff) | |
download | yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.gz yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.bz2 yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.lz yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.xz yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.zst yuzu-41013381d69f952f78b85de3ce226c1499d889b6.zip |
Diffstat (limited to 'src/common')
-rw-r--r-- | src/common/fiber.cpp | 8 |
1 files 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> 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<u8, default_stack_size> stack; @@ -106,10 +106,10 @@ Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_paramete : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, previous_fiber{} { impl = std::make_unique<FiberImpl>(); - void* stack_start = - static_cast<void*>(static_cast<std::uintptr_t>(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() { |