...one of the most highly
regarded and expertly designed C++ library projects in the
world.
— Herb Sutter and Andrei
Alexandrescu, C++
Coding Standards
A fcontext_t requires a stack which will be allocated/deallocated
by a StackAllocator. Boost.Context
uses stack_allocator
by default
but a customized stack allocator
can be passed to the context constructor instead. If a context is constructed
it invokes allocate() function and by its destruction
the stack gets released by deallocate().
A StackAllocator must satisfy the StackAllocator
concept requirements shown in the following table, in which a
is an object of a StackAllocator
type, p
is a void *
, and
s
is a std::size_t
:
expression |
return type |
notes |
---|---|---|
|
|
returns a pointer to |
|
|
deallocates |
Important | |
---|---|
The implementation of |
Important | |
---|---|
Calling |
Note | |
---|---|
The stack is not required to be aligned; alignment takes place inside |