Some context
In Boost 1.57 f_context
& make_fcontext
looks like this
// fcontext.hpp:
typedef void* fcontext_t;
fcontext_t BOOST_CONTEXT_CALLDECL make_fcontext( void * sp, std::size_t size, void (* fn)( intptr_t) );
How should I manage the resource returned by make_fcontext()
?
I have read the docs, asked on IRC and looked at the examples, but could not find anything. Is there a need to release/delete/close this resource?
For users,
fcontext_t
is a handle to identify context, and specify which context to jump to withjump_fcontext()
. The object pointed to by the opaque pointer returned frommake_fcontext(stack, context_function)
will be managed by the provided stack. The documentation states:One can also look into the Boost.Coroutine's implementation to see its usage of
fcontext_t
.