stack_context.hpp 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. // Copyright Oliver Kowalke 2009.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // (See accompanying file LICENSE_1_0.txt or copy at
  4. // http://www.boost.org/LICENSE_1_0.txt)
  5. #ifndef BOOST_COROUTINES_STACK_CONTEXT_H
  6. #define BOOST_COROUTINES_STACK_CONTEXT_H
  7. #include <cstddef>
  8. #include <boost/config.hpp>
  9. #include <boost/coroutine/detail/config.hpp>
  10. #ifdef BOOST_HAS_ABI_HEADERS
  11. # include BOOST_ABI_PREFIX
  12. #endif
  13. namespace boost {
  14. namespace coroutines {
  15. #if defined(BOOST_USE_SEGMENTED_STACKS)
  16. struct stack_context
  17. {
  18. typedef void * segments_context[BOOST_COROUTINES_SEGMENTS];
  19. std::size_t size;
  20. void * sp;
  21. segments_context segments_ctx;
  22. stack_context() :
  23. size( 0), sp( 0), segments_ctx()
  24. {}
  25. };
  26. #else
  27. struct stack_context
  28. {
  29. std::size_t size;
  30. void * sp;
  31. stack_context() :
  32. size( 0), sp( 0)
  33. {}
  34. };
  35. #endif
  36. }}
  37. #ifdef BOOST_HAS_ABI_HEADERS
  38. # include BOOST_ABI_SUFFIX
  39. #endif
  40. #endif // BOOST_COROUTINES_STACK_CONTEXT_H