libcopp  2.2.0
Public Member Functions
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 allocator::stack_allocator_malloc:
Collaboration graph

Public Member Functions

 stack_allocator_malloc () LIBCOPP_MACRO_NOEXCEPT
 
 ~stack_allocator_malloc ()
 
 stack_allocator_malloc (const stack_allocator_malloc &other) LIBCOPP_MACRO_NOEXCEPT
 
stack_allocator_mallocoperator= (const stack_allocator_malloc &other) LIBCOPP_MACRO_NOEXCEPT
 
 stack_allocator_malloc (stack_allocator_malloc &&other) LIBCOPP_MACRO_NOEXCEPT
 
stack_allocator_mallocoperator= (stack_allocator_malloc &&other) LIBCOPP_MACRO_NOEXCEPT
 
void allocate (stack_context &ctx, std::size_t size) LIBCOPP_MACRO_NOEXCEPT
 
void deallocate (stack_context &ctx) LIBCOPP_MACRO_NOEXCEPT
 

Detailed Description

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

Definition at line 24 of file stack_allocator_malloc.h.

Constructor & Destructor Documentation

◆ stack_allocator_malloc() [1/3]

LIBCOPP_COPP_API allocator::stack_allocator_malloc::stack_allocator_malloc ( )

Definition at line 33 of file stack_allocator_malloc.cpp.

◆ ~stack_allocator_malloc()

LIBCOPP_COPP_API allocator::stack_allocator_malloc::~stack_allocator_malloc ( )

Definition at line 34 of file stack_allocator_malloc.cpp.

◆ stack_allocator_malloc() [2/3]

LIBCOPP_COPP_API allocator::stack_allocator_malloc::stack_allocator_malloc ( const stack_allocator_malloc other)

Definition at line 35 of file stack_allocator_malloc.cpp.

◆ stack_allocator_malloc() [3/3]

LIBCOPP_COPP_API allocator::stack_allocator_malloc::stack_allocator_malloc ( stack_allocator_malloc &&  other)

Definition at line 42 of file stack_allocator_malloc.cpp.

Member Function Documentation

◆ allocate()

LIBCOPP_COPP_API void 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 48 of file stack_allocator_malloc.cpp.

References stack_traits::maximum_size(), stack_traits::minimum_size(), stack_traits::round_to_page_size(), and gsl::size().

◆ deallocate()

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

deallocate memory from stack context [standard function]

Parameters
ctxstack context

Definition at line 69 of file stack_allocator_malloc.cpp.

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

◆ operator=() [1/2]

LIBCOPP_COPP_API stack_allocator_malloc & allocator::stack_allocator_malloc::operator= ( const stack_allocator_malloc other)

Definition at line 37 of file stack_allocator_malloc.cpp.

◆ operator=() [2/2]

LIBCOPP_COPP_API stack_allocator_malloc & allocator::stack_allocator_malloc::operator= ( stack_allocator_malloc &&  other)

Definition at line 43 of file stack_allocator_malloc.cpp.


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