diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/fiber.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index 3978c8624..3c1eefcb7 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp | |||
| @@ -5,6 +5,7 @@ | |||
| 5 | #include "common/assert.h" | 5 | #include "common/assert.h" |
| 6 | #include "common/fiber.h" | 6 | #include "common/fiber.h" |
| 7 | #include "common/spin_lock.h" | 7 | #include "common/spin_lock.h" |
| 8 | #include "common/virtual_buffer.h" | ||
| 8 | 9 | ||
| 9 | #include <boost/context/detail/fcontext.hpp> | 10 | #include <boost/context/detail/fcontext.hpp> |
| 10 | 11 | ||
| @@ -13,8 +14,10 @@ namespace Common { | |||
| 13 | constexpr std::size_t default_stack_size = 256 * 1024; | 14 | constexpr std::size_t default_stack_size = 256 * 1024; |
| 14 | 15 | ||
| 15 | struct Fiber::FiberImpl { | 16 | struct Fiber::FiberImpl { |
| 16 | alignas(64) std::array<u8, default_stack_size> stack; | 17 | FiberImpl() : stack{default_stack_size}, rewind_stack{default_stack_size} {} |
| 17 | alignas(64) std::array<u8, default_stack_size> rewind_stack; | 18 | |
| 19 | VirtualBuffer<u8> stack; | ||
| 20 | VirtualBuffer<u8> rewind_stack; | ||
| 18 | 21 | ||
| 19 | SpinLock guard{}; | 22 | SpinLock guard{}; |
| 20 | std::function<void(void*)> entry_point; | 23 | std::function<void(void*)> entry_point; |