libcopp  1.1.0
Public Member Functions
copp::allocator::stack_allocator_malloc Class Reference

memory allocator this allocator will maintain buffer using malloc/free function More...

#include <stack_allocator_malloc.h>

Collaboration diagram for copp::allocator::stack_allocator_malloc:
Collaboration graph

Public Member Functions

 stack_allocator_malloc () UTIL_CONFIG_NOEXCEPT
 
 ~stack_allocator_malloc ()
 
void allocate (stack_context &ctx, std::size_t size) UTIL_CONFIG_NOEXCEPT
 
void deallocate (stack_context &ctx) UTIL_CONFIG_NOEXCEPT
 

Detailed Description

memory allocator this allocator will maintain buffer using malloc/free function

Definition at line 23 of file stack_allocator_malloc.h.

Constructor & Destructor Documentation

copp::allocator::stack_allocator_malloc::stack_allocator_malloc ( )

Definition at line 25 of file stack_allocator_malloc.cpp.

copp::allocator::stack_allocator_malloc::~stack_allocator_malloc ( )

Definition at line 26 of file stack_allocator_malloc.cpp.

Member Function Documentation

void copp::allocator::stack_allocator_malloc::allocate ( stack_context ctx,
std::size_t  size 
)

allocate memory and attach to stack context [standard function]

Parameters
ctxstack context
sizestack size
Note
size must less or equal than attached

Definition at line 28 of file stack_allocator_malloc.cpp.

References copp::stack_traits::maximum_size(), copp::stack_traits::minimum_size(), and copp::stack_traits::round_to_page_size().

void copp::allocator::stack_allocator_malloc::deallocate ( stack_context ctx)

deallocate memory from stack context [standard function]

Parameters
ctxstack context

Definition at line 49 of file stack_allocator_malloc.cpp.

References copp::stack_traits::is_unbounded(), copp::stack_traits::maximum_size(), and copp::stack_traits::minimum_size().


The documentation for this class was generated from the following files: