mn::memory Namespace Reference

Namespaces

 detail
 
 internal
 

Classes

struct  std_allocator_tag
 
struct  nodeleter_allocator_tag
 
struct  is_thread_safe_allocator
 
class  allocator_traits
 
class  basic_allocator_filter
 
class  basic_allocator
 
class  basic_allocator_maximal_filter
 
class  basic_allocator_stack_impl
 Stack based allocator. More...
 
class  basic_caps_allocator
 
class  basic_deleter
 A Simple template for a deleter. More...
 
class  basic_deleter< Type[], TAllocator >
 A Simple template for a deleter. More...
 
class  basic_malloc_allocator_impl
 
class  basic_multiheap_allocator_impl
 
class  basic_new_allocaor_impl
 
class  basic_threadsafed_allocator
 
struct  pointer_traits
 
struct  pointer_traits< T * >
 

Typedefs

template<int TBUFFERSIZE, class TFilter = basic_allocator_filter>
using stack_allocator = basic_allocator< basic_allocator_stack_impl< TBUFFERSIZE >, TFilter >
 
template<cap_allocator_map TCAPS, cap_allocator_size TSBITS, class TFilter = basic_allocator_filter>
using caps_allocator = basic_allocator< basic_caps_allocator< TCAPS, TSBITS >, TFilter >
 
template<class TFilter = basic_allocator_filter>
using malloc_allocator = basic_allocator< basic_malloc_allocator_impl, TFilter >
 
template<size_t TBytes, class TFilter = basic_allocator_filter>
using multiheap_allocator = basic_allocator< basic_multiheap_allocator_impl< TBytes >, TFilter >
 
template<class TFilter = basic_allocator_filter>
using new_allocator = basic_allocator< basic_new_allocaor_impl, TFilter >
 
using default_allocator = malloc_allocator< basic_allocator_filter >
 
template<typename Type , class TAllocator = default_allocator>
using default_delete = basic_deleter< Type, TAllocator >
 

Enumerations

enum class  cap_allocator_map {
  NotUse2 = MALLOC_CAP_PID2 , NotUse3 = MALLOC_CAP_PID3 , NotUse4 = MALLOC_CAP_PID4 , NotUse5 = MALLOC_CAP_PID5 ,
  NotUse6 = MALLOC_CAP_PID6 , NotUse7 = MALLOC_CAP_PID7 , SpiRam = MALLOC_CAP_SPIRAM , Internal = MALLOC_CAP_INTERNAL ,
  Default = MALLOC_CAP_DEFAULT , DMA = MALLOC_CAP_EXEC , Exec = MALLOC_CAP_DMA
}
 
enum class  cap_allocator_size { Size8Bit = MALLOC_CAP_8BIT , Size32Bit = MALLOC_CAP_32BIT }
 

Functions

template<class TAlloC >
void * allocate (const TAlloC &alloc, size_t size, size_t alignment, mn::memory::std_allocator_tag)
 
template<class TAlloC >
void * allocate (const TAlloC &alloc, size_t size, size_t alignment, mn::memory::nodeleter_allocator_tag)
 
template<class TAlloC >
void * deallocate (const TAlloC &alloc, void *address, size_t size, size_t alignment, mn::memory::std_allocator_tag)
 
template<class TAlloC >
void * deallocate (const TAlloC &alloc, void *address, size_t size, size_t alignment, mn::memory::nodeleter_allocator_tag)
 
template<class T >
constexpr T * to_address (T *v) noexcept
 
template<class T >
auto to_address (const T &v) noexcept
 

Class Documentation

◆ mn::memory::std_allocator_tag

struct mn::memory::std_allocator_tag

◆ mn::memory::nodeleter_allocator_tag

struct mn::memory::nodeleter_allocator_tag

Typedef Documentation

◆ caps_allocator

template<cap_allocator_map TCAPS, cap_allocator_size TSBITS, class TFilter = basic_allocator_filter>
using mn::memory::caps_allocator = typedef basic_allocator<basic_caps_allocator<TCAPS, TSBITS>, TFilter>

◆ default_allocator

◆ default_delete

template<typename Type , class TAllocator = default_allocator>
using mn::memory::default_delete = typedef basic_deleter<Type, TAllocator>

◆ malloc_allocator

template<class TFilter = basic_allocator_filter>
using mn::memory::malloc_allocator = typedef basic_allocator<basic_malloc_allocator_impl, TFilter>

◆ multiheap_allocator

template<size_t TBytes, class TFilter = basic_allocator_filter>
using mn::memory::multiheap_allocator = typedef basic_allocator<basic_multiheap_allocator_impl<TBytes>, TFilter>

◆ new_allocator

template<class TFilter = basic_allocator_filter>
using mn::memory::new_allocator = typedef basic_allocator<basic_new_allocaor_impl, TFilter>

◆ stack_allocator

template<int TBUFFERSIZE, class TFilter = basic_allocator_filter>
using mn::memory::stack_allocator = typedef basic_allocator<basic_allocator_stack_impl<TBUFFERSIZE>, TFilter>

Enumeration Type Documentation

◆ cap_allocator_map

Enumerator
NotUse2 

Memory must be mapped to PID2 memory space (PIDs are not currently used)

NotUse3 

Memory must be mapped to PID3 memory space (PIDs are not currently used)

NotUse4 

Memory must be mapped to PID4 memory space (PIDs are not currently used)

NotUse5 

Memory must be mapped to PID5 memory space (PIDs are not currently used)

NotUse6 

Memory must be mapped to PID6 memory space (PIDs are not currently used)

NotUse7 

Memory must be mapped to PID7 memory space (PIDs are not currently used)

SpiRam 

Memory must be in SPI RAM.

Internal 

Memory must be internal; specifically it should not disappear when flash/spiram cache is switched off.

Default 

Memory can be returned in a non-capability-specific memory allocation (e.g. malloc(), calloc()) call.

DMA 

Memory must be able to run executable code.

Exec 

Memory must be able to accessed by DMA.

◆ cap_allocator_size

Enumerator
Size8Bit 
Size32Bit 

Function Documentation

◆ allocate() [1/2]

template<class TAlloC >
void* mn::memory::allocate ( const TAlloC &  alloc,
size_t  size,
size_t  alignment,
mn::memory::nodeleter_allocator_tag   
)
inline

◆ allocate() [2/2]

template<class TAlloC >
void* mn::memory::allocate ( const TAlloC &  alloc,
size_t  size,
size_t  alignment,
mn::memory::std_allocator_tag   
)
inline

◆ deallocate() [1/2]

template<class TAlloC >
void* mn::memory::deallocate ( const TAlloC &  alloc,
void *  address,
size_t  size,
size_t  alignment,
mn::memory::nodeleter_allocator_tag   
)
inline

◆ deallocate() [2/2]

template<class TAlloC >
void* mn::memory::deallocate ( const TAlloC &  alloc,
void *  address,
size_t  size,
size_t  alignment,
mn::memory::std_allocator_tag   
)
inline

◆ to_address() [1/2]

template<class T >
auto mn::memory::to_address ( const T &  v)
inlinenoexcept

◆ to_address() [2/2]

template<class T >
constexpr T* mn::memory::to_address ( T *  v)
inlineconstexprnoexcept