3 #include <libcopp/utils/config/libcopp_build_features.h>
25 #ifdef LIBCOPP_MACRO_USE_SEGMENTED_STACKS
27 void *__splitstack_makecontext(std::size_t,
void *[COPP_MACRO_SEGMENTED_STACK_NUMBER], std::size_t *);
29 void __splitstack_releasecontext(
void *[COPP_MACRO_SEGMENTED_STACK_NUMBER]);
31 void __splitstack_resetcontext(
void *[COPP_MACRO_SEGMENTED_STACK_NUMBER]);
33 void __splitstack_block_signals_context(
void *[COPP_MACRO_SEGMENTED_STACK_NUMBER],
int *new_value,
int *old_value);
37 #ifdef COPP_HAS_ABI_HEADERS
38 # include COPP_ABI_PREFIX
41 LIBCOPP_COPP_NAMESPACE_BEGIN
48 LIBCOPP_MACRO_NOEXCEPT {}
62 std::size_t
size) LIBCOPP_MACRO_NOEXCEPT {
63 void *start_ptr = __splitstack_makecontext(
size, ctx.segments_ctx, &ctx.size);
70 ctx.sp =
static_cast<char *
>(start_ptr) + ctx.size;
73 __splitstack_block_signals_context(ctx.segments_ctx, &off, 0);
77 __splitstack_releasecontext(ctx.segments_ctx);
80 LIBCOPP_COPP_NAMESPACE_END
82 #ifdef COPP_HAS_ABI_HEADERS
83 # include COPP_ABI_SUFFIX
memory allocator this allocator will create buffer using gcc split segment api
void allocate(stack_context &, std::size_t) LIBCOPP_MACRO_NOEXCEPT
~stack_allocator_split_segment()
void deallocate(stack_context &) LIBCOPP_MACRO_NOEXCEPT
stack_allocator_split_segment & operator=(const stack_allocator_split_segment &other) LIBCOPP_MACRO_NOEXCEPT
stack_allocator_split_segment() LIBCOPP_MACRO_NOEXCEPT
constexpr auto size(TCONTAINER &&container) -> decltype(container.size())