3 #include <libcopp/utils/config/libcopp_build_features.h>
9 #if defined(LIBCOPP_MACRO_USE_VALGRIND)
10 # include <valgrind/valgrind.h>
27 #ifdef COPP_HAS_ABI_HEADERS
28 # include COPP_ABI_PREFIX
31 LIBCOPP_COPP_NAMESPACE_BEGIN
38 LIBCOPP_MACRO_NOEXCEPT {
44 LIBCOPP_MACRO_NOEXCEPT {
54 void *start_ptr = malloc(size_);
62 ctx.sp =
static_cast<char *
>(start_ptr) + ctx.size;
64 #
if defined(LIBCOPP_MACRO_USE_VALGRIND)
65 ctx.valgrind_stack_id = VALGRIND_STACK_REGISTER(ctx.sp, start_ptr);
74 #if defined(LIBCOPP_MACRO_USE_VALGRIND)
75 VALGRIND_STACK_DEREGISTER(ctx.valgrind_stack_id);
77 void *start_ptr =
static_cast<char *
>(ctx.sp) - ctx.size;
81 LIBCOPP_COPP_NAMESPACE_END
83 #ifdef COPP_HAS_ABI_HEADERS
84 # include COPP_ABI_SUFFIX
memory allocator this allocator will maintain buffer using malloc/free function
~stack_allocator_malloc()
void allocate(stack_context &ctx, std::size_t size) LIBCOPP_MACRO_NOEXCEPT
stack_allocator_malloc() LIBCOPP_MACRO_NOEXCEPT
stack_allocator_malloc & operator=(const stack_allocator_malloc &other) LIBCOPP_MACRO_NOEXCEPT
void deallocate(stack_context &ctx) LIBCOPP_MACRO_NOEXCEPT
constexpr auto size(TCONTAINER &&container) -> decltype(container.size())
static LIBCOPP_COPP_API std::size_t maximum_size() LIBCOPP_MACRO_NOEXCEPT
static LIBCOPP_COPP_API std::size_t round_to_page_size(std::size_t stacksize) LIBCOPP_MACRO_NOEXCEPT
static LIBCOPP_COPP_API std::size_t minimum_size() LIBCOPP_MACRO_NOEXCEPT
static LIBCOPP_COPP_API bool is_unbounded() LIBCOPP_MACRO_NOEXCEPT