mirror of
https://github.com/boostorg/coroutine2.git
synced 2025-05-09 23:24:01 +00:00
Merge branch 'develop'
This commit is contained in:
commit
1f6f5f61dc
@ -53,6 +53,7 @@
|
|||||||
[def __getline__ ['std::getline()]]
|
[def __getline__ ['std::getline()]]
|
||||||
[def __handle_read__ ['session::handle_read()]]
|
[def __handle_read__ ['session::handle_read()]]
|
||||||
[def __io_service__ ['boost::asio::io_sevice]]
|
[def __io_service__ ['boost::asio::io_sevice]]
|
||||||
|
[def __pooled_fixedsize__ ['pooled_fixedsize_stack]]
|
||||||
[def __protected_allocator__ ['protected_fixedsize]]
|
[def __protected_allocator__ ['protected_fixedsize]]
|
||||||
[def __protected_fixedsize__ ['protected_fixedsize_stack]]
|
[def __protected_fixedsize__ ['protected_fixedsize_stack]]
|
||||||
[def __pull_coro__ ['coroutine<>::pull_type]]
|
[def __pull_coro__ ['coroutine<>::pull_type]]
|
||||||
|
@ -95,25 +95,25 @@ the highest/lowest address of the stack.]]
|
|||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
|
||||||
[section:fixedsize Class ['fixedsize_stack]]
|
[section:pooled_fixedsize Class ['pooled_fixedsize_stack]]
|
||||||
|
|
||||||
__boost_coroutine__ provides the class __fixedsize__ which models
|
__boost_coroutine__ provides the class __pooled_fixedsize__ which models
|
||||||
the __stack_allocator_concept__.
|
the __stack_allocator_concept__.
|
||||||
In contrast to __protected_fixedsize__ it does not append a guard page at the
|
In contrast to __pooled_fixedsize__ it does not append a guard page at the
|
||||||
end of each stack. The memory is managed internally by
|
end of each stack. The memory is managed internally by
|
||||||
[@http://www.boost.org/doc/libs/release/libs/pool/doc/html/boost/pool.html `boost::pool<>`].
|
[@http://www.boost.org/doc/libs/release/libs/pool/doc/html/boost/pool.html `boost::pool<>`].
|
||||||
|
|
||||||
#include <boost/coroutine2/fixedsize_stack.hpp>
|
#include <boost/coroutine2/pooled_fixedsize_stack.hpp>
|
||||||
|
|
||||||
struct fixedsize_stack {
|
struct pooled_fixedsize_stack {
|
||||||
fixesize_stack(std::size_t size = traits_type::default_size());
|
pooled_fixedsize_stack(std::size_t size = traits_type::default_size());
|
||||||
|
|
||||||
stack_context allocate();
|
stack_context allocate();
|
||||||
|
|
||||||
void deallocate( stack_context &);
|
void deallocate( stack_context &);
|
||||||
}
|
}
|
||||||
|
|
||||||
[heading `fixesize_stack(std::size_t stack_size, std::size_t next_size, std::size_t max_size)]
|
[heading `pooled_fixedsize_stack(std::size_t stack_size, std::size_t next_size, std::size_t max_size)`]
|
||||||
[variablelist
|
[variablelist
|
||||||
[[Preconditions:] [`! traits_type::is_unbounded() && ( traits_type::maximum:size() >= stack_size)`
|
[[Preconditions:] [`! traits_type::is_unbounded() && ( traits_type::maximum:size() >= stack_size)`
|
||||||
and `0 < nest_size`.]]
|
and `0 < nest_size`.]]
|
||||||
@ -145,6 +145,44 @@ address of the stack.]]
|
|||||||
[endsect]
|
[endsect]
|
||||||
|
|
||||||
|
|
||||||
|
[section:fixedsize Class ['fixedsize_stack]]
|
||||||
|
|
||||||
|
__boost_coroutine__ provides the class __fixedsize__ which models
|
||||||
|
the __stack_allocator_concept__.
|
||||||
|
In contrast to __protected_fixedsize__ it does not append a guard page at the
|
||||||
|
end of each stack. The memory is simply managed by `std::malloc()` and
|
||||||
|
`std::free()`.
|
||||||
|
|
||||||
|
#include <boost/context/fixedsize_stack.hpp>
|
||||||
|
|
||||||
|
struct fixedsize_stack {
|
||||||
|
fixedsize_stack(std::size_t size = traits_type::default_size());
|
||||||
|
|
||||||
|
stack_context allocate();
|
||||||
|
|
||||||
|
void deallocate( stack_context &);
|
||||||
|
}
|
||||||
|
|
||||||
|
[heading `stack_context allocate()`]
|
||||||
|
[variablelist
|
||||||
|
[[Preconditions:] [`traits_type::minimum:size() <= size` and
|
||||||
|
`! traits_type::is_unbounded() && ( traits_type::maximum:size() >= size)`.]]
|
||||||
|
[[Effects:] [Allocates memory of at least `size` Bytes and stores a pointer to
|
||||||
|
the stack and its actual size in `sctx`. Depending on the architecture (the
|
||||||
|
stack grows downwards/upwards) the stored address is the highest/lowest
|
||||||
|
address of the stack.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[heading `void deallocate( stack_context & sctx)`]
|
||||||
|
[variablelist
|
||||||
|
[[Preconditions:] [`sctx.sp` is valid, `traits_type::minimum:size() <= sctx.size` and
|
||||||
|
`! traits_type::is_unbounded() && ( traits_type::maximum:size() >= sctx.size)`.]]
|
||||||
|
[[Effects:] [Deallocates the stack space.]]
|
||||||
|
]
|
||||||
|
|
||||||
|
[endsect]
|
||||||
|
|
||||||
|
|
||||||
[section:segmented Class ['segmented_stack]]
|
[section:segmented Class ['segmented_stack]]
|
||||||
|
|
||||||
__boost_coroutine__ supports usage of a __segmented__, e. g. the size of
|
__boost_coroutine__ supports usage of a __segmented__, e. g. the size of
|
||||||
|
Loading…
x
Reference in New Issue
Block a user