diff options
Diffstat (limited to 'src/common/fiber.cpp')
| -rw-r--r-- | src/common/fiber.cpp | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/common/fiber.cpp b/src/common/fiber.cpp index f97ad433b..1c1d09ccb 100644 --- a/src/common/fiber.cpp +++ b/src/common/fiber.cpp | |||
| @@ -54,9 +54,7 @@ Fiber::Fiber(std::function<void(void*)>&& entry_point_func, void* start_paramete | |||
| 54 | impl->handle = CreateFiber(default_stack_size, &FiberStartFunc, this); | 54 | impl->handle = CreateFiber(default_stack_size, &FiberStartFunc, this); |
| 55 | } | 55 | } |
| 56 | 56 | ||
| 57 | Fiber::Fiber() { | 57 | Fiber::Fiber() : impl{std::make_unique<FiberImpl>()} {} |
| 58 | impl = std::make_unique<FiberImpl>(); | ||
| 59 | } | ||
| 60 | 58 | ||
| 61 | Fiber::~Fiber() { | 59 | Fiber::~Fiber() { |
| 62 | if (released) { | 60 | if (released) { |
| @@ -116,8 +114,8 @@ std::shared_ptr<Fiber> Fiber::ThreadToFiber() { | |||
| 116 | 114 | ||
| 117 | struct Fiber::FiberImpl { | 115 | struct Fiber::FiberImpl { |
| 118 | alignas(64) std::array<u8, default_stack_size> stack; | 116 | alignas(64) std::array<u8, default_stack_size> stack; |
| 119 | u8* stack_limit; | ||
| 120 | alignas(64) std::array<u8, default_stack_size> rewind_stack; | 117 | alignas(64) std::array<u8, default_stack_size> rewind_stack; |
| 118 | u8* stack_limit; | ||
| 121 | u8* rewind_stack_limit; | 119 | u8* rewind_stack_limit; |
| 122 | boost::context::detail::fcontext_t context; | 120 | boost::context::detail::fcontext_t context; |
| 123 | boost::context::detail::fcontext_t rewind_context; | 121 | boost::context::detail::fcontext_t rewind_context; |
| @@ -168,9 +166,7 @@ void Fiber::SetRewindPoint(std::function<void(void*)>&& rewind_func, void* start | |||
| 168 | rewind_parameter = start_parameter; | 166 | rewind_parameter = start_parameter; |
| 169 | } | 167 | } |
| 170 | 168 | ||
| 171 | Fiber::Fiber() { | 169 | Fiber::Fiber() : impl{std::make_unique<FiberImpl>()} {} |
| 172 | impl = std::make_unique<FiberImpl>(); | ||
| 173 | } | ||
| 174 | 170 | ||
| 175 | Fiber::~Fiber() { | 171 | Fiber::~Fiber() { |
| 176 | if (released) { | 172 | if (released) { |