mn::memory::basic_allocator_stack_impl< TBUFFERSIZE > Class Template Reference

Stack based allocator. More...

#include <mn_basic_allocator_stack.hpp>

Public Types

using allocator_category = std_allocator_tag()
 
using is_thread_safe = std::false_type
 

Static Public Member Functions

static void first () noexcept
 
static void * allocate (size_t size, size_t alignment) noexcept
 
static void deallocate (void *ptr, size_t size, size_t alignment) noexcept
 
static size_t max_node_size ()
 
static size_t get_max_alocator_size ()
 

Static Private Attributes

static size_t m_bufferTop = 0
 
static char * m_aBuffer [TBUFFERSIZE]
 

Detailed Description

template<int TBUFFERSIZE>
class mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >

Stack based allocator.

Note
- operates on buffer of TBUFFERSIZE bytes of stack memory
- never frees memory
- cannot be copied
Author
RoseLeBlood
Date
2021.02.21
Version
1.0

Member Typedef Documentation

◆ allocator_category

template<int TBUFFERSIZE>
using mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::allocator_category = std_allocator_tag()

◆ is_thread_safe

template<int TBUFFERSIZE>
using mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::is_thread_safe = std::false_type

Member Function Documentation

◆ allocate()

template<int TBUFFERSIZE>
static void* mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::allocate ( size_t  size,
size_t  alignment 
)
inlinestaticnoexcept

◆ deallocate()

template<int TBUFFERSIZE>
static void mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::deallocate ( void *  ptr,
size_t  size,
size_t  alignment 
)
inlinestaticnoexcept

◆ first()

template<int TBUFFERSIZE>
static void mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::first ( )
inlinestaticnoexcept

◆ get_max_alocator_size()

template<int TBUFFERSIZE>
static size_t mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::get_max_alocator_size ( )
inlinestatic

◆ max_node_size()

template<int TBUFFERSIZE>
static size_t mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::max_node_size ( )
inlinestatic

Member Data Documentation

◆ m_aBuffer

template<int TBUFFERSIZE>
char * mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::m_aBuffer
staticprivate

◆ m_bufferTop

template<int TBUFFERSIZE>
size_t mn::memory::basic_allocator_stack_impl< TBUFFERSIZE >::m_bufferTop = 0
staticprivate

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