diff options
| author | 2020-02-26 17:34:23 -0400 | |
|---|---|---|
| committer | 2020-06-18 16:29:25 -0400 | |
| commit | 41013381d69f952f78b85de3ce226c1499d889b6 (patch) | |
| tree | 0f1f0e06e76eaf67488b98663dffe10e296f83c3 /src | |
| parent | Common/Fiber: Correct f_context based Fibers. (diff) | |
| download | yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.gz yuzu-41013381d69f952f78b85de3ce226c1499d889b6.tar.xz yuzu-41013381d69f952f78b85de3ce226c1499d889b6.zip | |
Common/Fiber: Additional corrections to f_context.
Diffstat (limited to 'src')
| -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() { | |||
| 81 | } | 81 | } |
| 82 | 82 | ||
| 83 | #else | 83 | #else |
| 84 | constexpr std::size_t default_stack_size = 1024 * 1024; // 4MB | 84 | constexpr std::size_t default_stack_size = 1024 * 1024; // 1MB |
| 85 | 85 | ||
| 86 | struct Fiber::FiberImpl { | 86 | struct Fiber::FiberImpl { |
| 87 | alignas(64) std::array<u8, default_stack_size> stack; | 87 | 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 | |||
| 106 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, | 106 | : guard{}, entry_point{std::move(entry_point_func)}, start_parameter{start_parameter}, |
| 107 | previous_fiber{} { | 107 | previous_fiber{} { |
| 108 | impl = std::make_unique<FiberImpl>(); | 108 | impl = std::make_unique<FiberImpl>(); |
| 109 | void* stack_start = | 109 | u8* stack_limit = impl->stack.data(); |
| 110 | static_cast<void*>(static_cast<std::uintptr_t>(impl->stack.data()) + default_stack_size); | 110 | u8* stack_base = stack_limit + default_stack_size; |
| 111 | impl->context = | 111 | impl->context = |
| 112 | boost::context::detail::make_fcontext(stack_start, impl->stack.size(), FiberStartFunc); | 112 | boost::context::detail::make_fcontext(stack_base, impl->stack.size(), FiberStartFunc); |
| 113 | } | 113 | } |
| 114 | 114 | ||
| 115 | Fiber::Fiber() { | 115 | Fiber::Fiber() { |