emlabcpp
modern opinionated embedded C++ library
emlabcpp::pmr Namespace Reference

MIT License. More...

Classes

struct  deleter
 
class  allocator
 
class  memory_resource
 
struct  new_delete_resource_impl
 
class  pool_resource
 
class  stack_resource
 

Typedefs

template<typename T >
using unique_ptr = std::unique_ptr< T, deleter >
 
template<typename T >
using vector = std::vector< T, allocator< T > >
 
template<typename T >
using list = std::list< T, allocator< T > >
 
template<typename T >
using set = std::set< T, allocator< T > >
 
template<typename T >
using deque = std::deque< T, allocator< T > >
 
template<typename Key , typename T >
using map = std::map< Key, T, std::less< Key >, allocator< std::pair< Key const, T > > >
 

Functions

memory_resourcenew_delete_resource ()
 
void throw_bad_alloc ()
 
constexpr std::uintptr_t align_addr (std::uintptr_t const addr, std::size_t const alignment)
 
void * align (void *const ptr, std::size_t const alignment)
 TODO: this needs tests. More...
 

Detailed Description

MIT License.

Copyright (c) 2025 Jan Veverak Koniarik

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Typedef Documentation

◆ deque

template<typename T >
using emlabcpp::pmr::deque = typedef std::deque< T, allocator< T > >

◆ list

template<typename T >
using emlabcpp::pmr::list = typedef std::list< T, allocator< T > >

◆ map

template<typename Key , typename T >
using emlabcpp::pmr::map = typedef std::map< Key, T, std::less< Key >, allocator< std::pair< Key const, T > > >

◆ set

template<typename T >
using emlabcpp::pmr::set = typedef std::set< T, allocator< T > >

◆ unique_ptr

template<typename T >
using emlabcpp::pmr::unique_ptr = typedef std::unique_ptr< T, deleter >

◆ vector

template<typename T >
using emlabcpp::pmr::vector = typedef std::vector< T, allocator< T > >

Function Documentation

◆ align()

void* emlabcpp::pmr::align ( void *const  ptr,
std::size_t const  alignment 
)
inline

TODO: this needs tests.

References align_addr().

◆ align_addr()

constexpr std::uintptr_t emlabcpp::pmr::align_addr ( std::uintptr_t const  addr,
std::size_t const  alignment 
)
constexpr

◆ new_delete_resource()

memory_resource& emlabcpp::pmr::new_delete_resource ( )
inline

◆ throw_bad_alloc()

void emlabcpp::pmr::throw_bad_alloc ( )
inline