Fiber& operator=(const Fiber&) = delete;
~Fiber();
+
+ /**
+ * Retrieve this fiber's base stack and stack size.
+ *
+ * @return This fiber's stack pointer and stack size.
+ */
+ std::pair<void*, size_t> getStack() const {
+ void* const stack =
+ std::min<void*>(fcontext_.stackLimit(), fcontext_.stackBase());
+ const size_t size = std::abs<intptr_t>(
+ reinterpret_cast<intptr_t>(fcontext_.stackBase()) -
+ reinterpret_cast<intptr_t>(fcontext_.stackLimit()));
+ return { stack, size };
+ }
+
private:
enum State {
INVALID, /**< Does't have task function */