Loading...
Searching...
No Matches
memory.h File Reference
`#include "platform.h"`
`#include "algorithm.h"`
`#include "alignment.h"`
`#include "iterator.h"`
`#include "nullptr.h"`
`#include "placement_new.h"`
`#include "type_traits.h"`
`#include "utility.h"`
`#include "private/addressof.h"`
`#include <string.h>`
`#include <memory>`

Go to the source code of this file.

## Classes

struct | etl::pointer_traits< T >
struct | etl::pointer_traits< T * >
struct | etl::default_delete< T >
struct | etl::default_delete< T[]>
class | etl::unique_ptr< T, TDeleter >
class | etl::unique_ptr< T[], TDeleter >
struct | etl::create_copy< T >
struct | etl::wipe_on_destruct< T >
class | etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >
class | etl::uninitialized_buffer_of< T, VN_Objects >

## Namespaces

namespace | etl

## Functions

template<typename T>
ETL_CONSTEXPR T * | etl::to_address (T *p) ETL_NOEXCEPT
template<typename Iterator>
ETL_CONSTEXPR Iterator::pointer | etl::to_address (const Iterator &itr) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD ETL_CONSTEXPR17 T * | etl::launder (T *p) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD T * | etl::private_memory::start_lifetime_as_impl (void *p, size_t n) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD T * | etl::start_lifetime_as (void *p) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD const T * | etl::start_lifetime_as (const void *p) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD volatile T * | etl::start_lifetime_as (volatile void *p) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD const volatile T * | etl::start_lifetime_as (const volatile void *p) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD T * | etl::start_lifetime_as_array (void *p, size_t n) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD const T * | etl::start_lifetime_as_array (const void *p, size_t n) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD volatile T * | etl::start_lifetime_as_array (volatile void *p, size_t n) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD const volatile T * | etl::start_lifetime_as_array (const volatile void *p, size_t n) ETL_NOEXCEPT
void * | etl::align (size_t alignment, size_t size, void *&ptr, size_t &space) ETL_NOEXCEPT
template<size_t N, typename T>
ETL_NODISCARD ETL_CONSTEXPR T * | etl::assume_aligned (T *ptr) ETL_NOEXCEPT
template<size_t Alignment, typename T>
ETL_NODISCARD bool | etl::is_sufficiently_aligned (T *ptr) ETL_NOEXCEPT
template<typename TOutputIterator, typename T>
TOutputIterator | etl::uninitialized_fill (TOutputIterator o_begin, TOutputIterator o_end, const T &value)
template<typename TOutputIterator, typename T, typename TCounter>
TOutputIterator | etl::uninitialized_fill (TOutputIterator o_begin, TOutputIterator o_end, const T &value, TCounter &count)
template<typename TOutputIterator, typename TSize, typename T>
TOutputIterator | etl::uninitialized_fill_n (TOutputIterator o_begin, TSize n, const T &value)
template<typename TOutputIterator, typename TSize, typename T, typename TCounter>
TOutputIterator | etl::uninitialized_fill_n (TOutputIterator o_begin, TSize n, const T &value, TCounter &count)
template<typename TInputIterator, typename TOutputIterator>
TOutputIterator | etl::uninitialized_copy (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin)
template<typename TInputIterator, typename TOutputIterator, typename TCounter>
TOutputIterator | etl::uninitialized_copy (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TCounter &count)
template<typename TInputIterator, typename TSize, typename TOutputIterator>
TOutputIterator | etl::uninitialized_copy_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin)
template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TCounter>
TOutputIterator | etl::uninitialized_copy_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TCounter &count)
template<typename TInputIterator, typename TOutputIterator>
TOutputIterator | etl::uninitialized_move (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin)
template<typename TInputIterator, typename TOutputIterator, typename TCounter>
TOutputIterator | etl::uninitialized_move (TInputIterator i_begin, TInputIterator i_end, TOutputIterator o_begin, TCounter &count)
template<typename TInputIterator, typename TSize, typename TOutputIterator>
TOutputIterator | etl::uninitialized_move_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin)
template<typename TInputIterator, typename TSize, typename TOutputIterator, typename TCounter>
TOutputIterator | etl::uninitialized_move_n (TInputIterator i_begin, TSize n, TOutputIterator o_begin, TCounter &count)
template<typename TOutputIterator>
etl::enable_if< etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_default_construct (TOutputIterator, TOutputIterator)
template<typename TOutputIterator>
etl::enable_if<!etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_default_construct (TOutputIterator o_begin, TOutputIterator o_end)
template<typename TOutputIterator, typename TCounter>
etl::enable_if< etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_default_construct (TOutputIterator o_begin, TOutputIterator o_end, TCounter &count)
template<typename TOutputIterator, typename TCounter>
etl::enable_if<!etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_default_construct (TOutputIterator o_begin, TOutputIterator o_end, TCounter &count)
template<typename TOutputIterator, typename TSize>
etl::enable_if< etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, TOutputIterator >::type | etl::uninitialized_default_construct_n (TOutputIterator o_begin, TSize n)
template<typename TOutputIterator, typename TSize>
etl::enable_if<!etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, TOutputIterator >::type | etl::uninitialized_default_construct_n (TOutputIterator o_begin, TSize n)
template<typename TOutputIterator, typename TSize, typename TCounter>
etl::enable_if< etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, TOutputIterator >::type | etl::uninitialized_default_construct_n (TOutputIterator o_begin, TSize n, TCounter &count)
template<typename TOutputIterator, typename TSize, typename TCounter>
etl::enable_if<!etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, TOutputIterator >::type | etl::uninitialized_default_construct_n (TOutputIterator o_begin, TSize n, TCounter &count)
template<typename TOutputIterator>
etl::enable_if< etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_value_construct (TOutputIterator o_begin, TOutputIterator o_end)
template<typename TOutputIterator>
etl::enable_if<!etl::is_trivially_constructible< typenameetl::iterator_traits< TOutputIterator >::value_type >::value, void >::type | etl::uninitialized_value_construct (TOutputIterator o_begin, TOutputIterator o_end)
template<typename TOutputIterator, typename TCounter>
void | etl::uninitialized_value_construct (TOutputIterator o_begin, TOutputIterator o_end, TCounter &count)
template<typename TOutputIterator, typename TSize>
TOutputIterator | etl::uninitialized_value_construct_n (TOutputIterator o_begin, TSize n)
template<typename TOutputIterator, typename TSize, typename TCounter>
TOutputIterator | etl::uninitialized_value_construct_n (TOutputIterator o_begin, TSize n, TCounter &count)
template<typename T>
T * | etl::construct_at (T *p)
template<typename T, typename TArg>
T * | etl::construct_at (T *p, const TArg &arg)
template<typename T>
etl::enable_if< etl::is_trivially_destructible< T >::value, void >::type | etl::destroy_at (T *)
template<typename T>
etl::enable_if<!etl::is_trivially_destructible< T >::value, void >::type | etl::destroy_at (T *p)
template<typename T, typename TCounter>
etl::enable_if< etl::is_trivially_destructible< T >::value, void >::type | etl::destroy_at (T *, TCounter &count)
template<typename T, typename TCounter>
etl::enable_if<!etl::is_trivially_destructible< T >::value, void >::type | etl::destroy_at (T *p, TCounter &count)
template<typename TIterator>
etl::enable_if< etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, void >::type | etl::destroy (TIterator, TIterator)
template<typename TIterator>
etl::enable_if<!etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, void >::type | etl::destroy (TIterator i_begin, TIterator i_end)
template<typename TIterator, typename TCounter>
etl::enable_if< etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, void >::type | etl::destroy (TIterator i_begin, TIterator i_end, TCounter &count)
template<typename TIterator, typename TCounter>
etl::enable_if<!etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, void >::type | etl::destroy (TIterator i_begin, TIterator i_end, TCounter &count)
template<typename TIterator, typename TSize>
etl::enable_if< etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, TIterator >::type | etl::destroy_n (TIterator i_begin, TSize n)
template<typename TIterator, typename TSize>
etl::enable_if<!etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, TIterator >::type | etl::destroy_n (TIterator i_begin, TSize n)
template<typename TIterator, typename TSize, typename TCounter>
etl::enable_if< etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, TIterator >::type | etl::destroy_n (TIterator i_begin, TSize n, TCounter &count)
template<typename TIterator, typename TSize, typename TCounter>
etl::enable_if<!etl::is_trivially_destructible< typenameetl::iterator_traits< TIterator >::value_type >::value, TIterator >::type | etl::destroy_n (TIterator i_begin, TSize n, TCounter &count)
template<typename T1, typename TD1, typename T2, typename TD2>
bool | etl::operator== (const etl::unique_ptr< T1, TD1 > &lhs, const etl::unique_ptr< T2, TD2 > &rhs)
template<typename T1, typename TD1, typename T2, typename TD2>
bool | etl::operator< (const etl::unique_ptr< T1, TD1 > &lhs, const etl::unique_ptr< T2, TD2 > &rhs)
template<typename T1, typename TD1, typename T2, typename TD2>
bool | etl::operator<= (const etl::unique_ptr< T1, TD1 > &lhs, const etl::unique_ptr< T2, TD2 > &rhs)
template<typename T1, typename TD1, typename T2, typename TD2>
bool | etl::operator> (const etl::unique_ptr< T1, TD1 > &lhs, const etl::unique_ptr< T2, TD2 > &rhs)
template<typename T1, typename TD1, typename T2, typename TD2>
bool | etl::operator>= (const etl::unique_ptr< T1, TD1 > &lhs, const etl::unique_ptr< T2, TD2 > &rhs)
template<typename T>
etl::enable_if< etl::is_trivially_constructible< T >::value, void >::type | etl::create_default_at (T *)
template<typename T, typename TCounter>
etl::enable_if< etl::is_trivially_constructible< T >::value, void >::type | etl::create_default_at (T *, TCounter &count)
template<typename T>
etl::enable_if<!etl::is_trivially_constructible< T >::value, void >::type | etl::create_default_at (T *p)
template<typename T, typename TCounter>
etl::enable_if<!etl::is_trivially_constructible< T >::value, void >::type | etl::create_default_at (T *p, TCounter &count)
template<typename T>
void | etl::create_value_at (T *p)
template<typename T, typename TCounter>
void | etl::create_value_at (T *p, TCounter &count)
template<typename T>
void | etl::create_copy_at (T *p, const T &value)
template<typename T, typename TCounter>
void | etl::create_copy_at (T *p, const T &value, TCounter &count)
template<typename T>
T & | etl::make_default_at (T *p)
template<typename T, typename TCounter>
T & | etl::make_default_at (T *p, TCounter &count)
template<typename T>
T & | etl::make_copy_at (T *p, const T &other)
template<typename T, typename TCounter>
T & | etl::make_copy_at (T *p, const T &other, TCounter &count)
template<typename T, typename TParameter>
T & | etl::make_value_at (T *p, const TParameter &value)
template<typename T, typename TParameter, typename TCounter>
T & | etl::make_value_at (T *p, const TParameter &value, TCounter &count)
void | etl::memory_clear (volatile char *p, size_t n)
template<typename T>
void | etl::memory_clear (volatile T &object)
template<typename T>
void | etl::memory_clear_range (volatile T *begin, size_t n)
template<typename T>
void | etl::memory_clear_range (volatile T *begin, volatile T *end)
void | etl::memory_set (volatile char *p, size_t n, char value)
template<typename T>
void | etl::memory_set (volatile T &object, const char value)
template<typename T>
void | etl::memory_set_range (volatile T *begin, size_t n, const char value)
template<typename T>
void | etl::memory_set_range (volatile T *begin, volatile T *end, const char value)
template<typename T>
T * | etl::mem_copy (const T *sb, const T *se, T *db) ETL_NOEXCEPT
template<typename T>
T * | etl::mem_copy (const T *sb, size_t n, T *db) ETL_NOEXCEPT
template<typename T>
T * | etl::mem_move (const T *sb, const T *se, T *db) ETL_NOEXCEPT
template<typename T>
T * | etl::mem_move (const T *sb, size_t n, T *db) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD int | etl::mem_compare (const T *sb, const T *se, const T *db) ETL_NOEXCEPT
template<typename T>
ETL_NODISCARD int | etl::mem_compare (const T *sb, size_t n, const T *db) ETL_NOEXCEPT
template<typename TPointer, typename T>
etl::enable_if< etl::is_pointer< TPointer >::value &&!etl::is_const< TPointer >::value &&etl::is_integral< T >::value &&sizeof(T)==1, TPointer >::type | etl::mem_set (TPointer db, const TPointer de, T value) ETL_NOEXCEPT
template<typename TPointer, typename T>
etl::enable_if< etl::is_pointer< TPointer >::value &&!etl::is_const< TPointer >::value &&etl::is_integral< T >::value &&sizeof(T)==1, TPointer >::type | etl::mem_set (TPointer db, size_t n, T value) ETL_NOEXCEPT
template<typename TPointer, typename T>
ETL_NODISCARD etl::enable_if< etl::is_pointer< TPointer >::value &&!etl::is_const< typenameetl::remove_pointer< TPointer >::type >::value &&etl::is_integral< T >::value &&sizeof(T)==1, char * >::type | etl::mem_char (TPointer sb, TPointer se, T value) ETL_NOEXCEPT
template<typename TPointer, typename T>
ETL_NODISCARD etl::enable_if< etl::is_pointer< TPointer >::value &&etl::is_const< typenameetl::remove_pointer< TPointer >::type >::value &&etl::is_integral< T >::value &&sizeof(T)==1, constchar * >::type | etl::mem_char (TPointer sb, TPointer se, T value) ETL_NOEXCEPT
template<typename TPointer, typename T>
ETL_NODISCARD etl::enable_if< etl::is_pointer< TPointer >::value &&!etl::is_const< typenameetl::remove_pointer< TPointer >::type >::value &&etl::is_integral< T >::value &&sizeof(T)==1, char * >::type | etl::mem_char (TPointer sb, size_t n, T value) ETL_NOEXCEPT
template<typename TPointer, typename T>
ETL_NODISCARD etl::enable_if< etl::is_pointer< TPointer >::value &&etl::is_const< typenameetl::remove_pointer< TPointer >::type >::value &&etl::is_integral< T >::value &&sizeof(T)==1, constchar * >::type | etl::mem_char (TPointer sb, size_t n, T value) ETL_NOEXCEPT
template<typename TObject>
TObject & | etl::construct_object_at (void *p)
| Default construct the container at 'p'.
template<typename TObject>
TObject & | etl::construct_object_at (void *p, const TObject &other)
| Copy construct the container at 'p'.
template<typename TObject, typename TArg>
TObject & | etl::construct_object_at (void *p, const TArg &arg)
| Construct the container at 'p' from argument.
template<typename TObject>
TObject & | etl::get_object_at (void *p)
| Get the container at 'p'.
template<typename TObject>
const TObject & | etl::get_object_at (const void *p)
| Get the container at const 'p'.
template<typename TObject>
void | etl::destroy_object_at (void *p)

## Variables

template<size_t VObject_Size, size_t VN_Objects, size_t VAlignment>
ETL_CONSTANT size_t | etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >::Object_Size
template<size_t VObject_Size, size_t VN_Objects, size_t VAlignment>
ETL_CONSTANT size_t | etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >::N_Objects
template<size_t VObject_Size, size_t VN_Objects, size_t VAlignment>
ETL_CONSTANT size_t | etl::uninitialized_buffer< VObject_Size, VN_Objects, VAlignment >::Alignment
template<typename T, size_t VN_Objects>
ETL_CONSTANT size_t | etl::uninitialized_buffer_of< T, VN_Objects >::Object_Size
template<typename T, size_t VN_Objects>
ETL_CONSTANT size_t | etl::uninitialized_buffer_of< T, VN_Objects >::N_Objects
template<typename T, size_t VN_Objects>
ETL_CONSTANT size_t | etl::uninitialized_buffer_of< T, VN_Objects >::Alignment

## Function Documentation

## start_lifetime_as_impl()

template<typename T>

ETL_NODISCARD T * etl::private_memory::start_lifetime_as_impl | ( | void * | p,
|  | size_t | n )

inline

Implicitly create the objects in [p, p + n) and return a usable pointer to the first one. Used by start_lifetime_as / start_lifetime_as_array.