/usr/include/boost/context
NameSizeModeActions
detail/-0755rm
posix/-0755rm
windows/-0755rm
continuation.hpp4410644editdlrm
continuation_fcontext.hpp118290644editdlrm
continuation_ucontext.hpp184140644editdlrm
continuation_winfib.hpp153170644editdlrm
fiber.hpp4200644editdlrm
fiber_fcontext.hpp117600644editdlrm
fiber_ucontext.hpp183920644editdlrm
fiber_winfib.hpp151600644editdlrm
fixedsize_stack.hpp23350644editdlrm
flags.hpp5820644editdlrm
pooled_fixedsize_stack.hpp43830644editdlrm
preallocated.hpp8280644editdlrm
protected_fixedsize_stack.hpp4080644editdlrm
segmented_stack.hpp3800644editdlrm
stack_context.hpp16890644editdlrm
stack_traits.hpp9570644editdlrm
Edit: /usr/include/boost/context/fixedsize_stack.hpp (2335B)
// Copyright Oliver Kowalke 2014. // Distributed under the Boost Software License, Version 1.0. // (See accompanying file LICENSE_1_0.txt or copy at // http://www.boost.org/LICENSE_1_0.txt) #ifndef BOOST_CONTEXT_FIXEDSIZE_H #define BOOST_CONTEXT_FIXEDSIZE_H #include #include #include #include #include #include #include #include #if defined(BOOST_CONTEXT_USE_MAP_STACK) extern "C" { #include } #endif #if defined(BOOST_USE_VALGRIND) #include #endif #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_PREFIX #endif namespace boost { namespace context { template< typename traitsT > class basic_fixedsize_stack { private: std::size_t size_; public: typedef traitsT traits_type; basic_fixedsize_stack( std::size_t size = traits_type::default_size() ) BOOST_NOEXCEPT_OR_NOTHROW : size_( size) { } stack_context allocate() { #if defined(BOOST_CONTEXT_USE_MAP_STACK) void * vp = ::mmap( 0, size_, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_ANON | MAP_STACK, -1, 0); if ( vp == MAP_FAILED) { throw std::bad_alloc(); } #else void * vp = std::malloc( size_); if ( ! vp) { throw std::bad_alloc(); } #endif stack_context sctx; sctx.size = size_; sctx.sp = static_cast< char * >( vp) + sctx.size; #if defined(BOOST_USE_VALGRIND) sctx.valgrind_stack_id = VALGRIND_STACK_REGISTER( sctx.sp, vp); #endif return sctx; } void deallocate( stack_context & sctx) BOOST_NOEXCEPT_OR_NOTHROW { BOOST_ASSERT( sctx.sp); #if defined(BOOST_USE_VALGRIND) VALGRIND_STACK_DEREGISTER( sctx.valgrind_stack_id); #endif void * vp = static_cast< char * >( sctx.sp) - sctx.size; #if defined(BOOST_CONTEXT_USE_MAP_STACK) ::munmap( vp, sctx.size); #else std::free( vp); #endif } }; typedef basic_fixedsize_stack< stack_traits > fixedsize_stack; # if ! defined(BOOST_USE_SEGMENTED_STACKS) typedef fixedsize_stack default_stack; # endif }} #ifdef BOOST_HAS_ABI_HEADERS # include BOOST_ABI_SUFFIX #endif #endif // BOOST_CONTEXT_FIXEDSIZE_H