3 #include <libcopp/utils/config/libcopp_build_features.h>
9 #ifndef WIN32_LEAN_AND_MEAN
10 # define WIN32_LEAN_AND_MEAN
29 #if defined(COPP_MACRO_COMPILER_MSVC)
30 # pragma warning(push)
31 # pragma warning(disable : 4244 4267)
34 #ifdef COPP_HAS_ABI_HEADERS
35 # include COPP_ABI_PREFIX
38 LIBCOPP_COPP_NAMESPACE_BEGIN
44 LIBCOPP_MACRO_NOEXCEPT {}
46 LIBCOPP_MACRO_NOEXCEPT {
52 LIBCOPP_MACRO_NOEXCEPT {
61 assert(
size > 0 && size_ > 0);
63 void *start_ptr = ::VirtualAlloc(0, size_, MEM_COMMIT, PAGE_READWRITE);
74 ctx.sp =
static_cast<char *
>(start_ptr) + ctx.size;
82 void *start_ptr =
static_cast<char *
>(ctx.sp) - ctx.size;
83 ::VirtualFree(start_ptr, 0, MEM_RELEASE);
86 LIBCOPP_COPP_NAMESPACE_END
88 #ifdef COPP_HAS_ABI_HEADERS
89 # include COPP_ABI_SUFFIX
memory allocator this allocator will create buffer using windows api and protect it
void deallocate(stack_context &) LIBCOPP_MACRO_NOEXCEPT
void allocate(stack_context &, std::size_t) LIBCOPP_MACRO_NOEXCEPT
stack_allocator_windows & operator=(const stack_allocator_windows &other) LIBCOPP_MACRO_NOEXCEPT
stack_allocator_windows() LIBCOPP_MACRO_NOEXCEPT
~stack_allocator_windows()
constexpr auto size(TCONTAINER &&container) -> decltype(container.size())
static LIBCOPP_COPP_API std::size_t page_size() LIBCOPP_MACRO_NOEXCEPT
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