libstdc++
Memory
Collaboration diagram for Memory:

Modules

 Allocators
 
 Pointer Abstractions
 
 Pointer Safety and Garbage Collection
 

Files

file  memory
 

Macros

#define __cpp_lib_raw_memory_algorithms
 

Functions

void * std::align (size_t __align, size_t __size, void *&__ptr, size_t &__space) noexcept
 
template<size_t _Align, class _Tp >
constexpr _Tp * std::assume_aligned (_Tp *__ptr) noexcept
 
template<typename _InputIterator , typename _ForwardIterator >
_ForwardIterator std::uninitialized_copy (_InputIterator __first, _InputIterator __last, _ForwardIterator __result)
 
template<typename _InputIterator , typename _Size , typename _ForwardIterator >
_ForwardIterator std::uninitialized_copy_n (_InputIterator __first, _Size __n, _ForwardIterator __result)
 
template<typename _ForwardIterator >
void std::uninitialized_default_construct (_ForwardIterator __first, _ForwardIterator __last)
 
template<typename _ForwardIterator , typename _Size >
_ForwardIterator std::uninitialized_default_construct_n (_ForwardIterator __first, _Size __count)
 
template<typename _ForwardIterator , typename _Tp >
void std::uninitialized_fill (_ForwardIterator __first, _ForwardIterator __last, const _Tp &__x)
 
template<typename _ForwardIterator , typename _Size , typename _Tp >
_ForwardIterator std::uninitialized_fill_n (_ForwardIterator __first, _Size __n, const _Tp &__x)
 
template<typename _InputIterator , typename _ForwardIterator >
_ForwardIterator std::uninitialized_move (_InputIterator __first, _InputIterator __last, _ForwardIterator __result)
 
template<typename _InputIterator , typename _Size , typename _ForwardIterator >
pair< _InputIterator, _ForwardIterator > std::uninitialized_move_n (_InputIterator __first, _Size __count, _ForwardIterator __result)
 
template<typename _ForwardIterator >
void std::uninitialized_value_construct (_ForwardIterator __first, _ForwardIterator __last)
 
template<typename _ForwardIterator , typename _Size >
_ForwardIterator std::uninitialized_value_construct_n (_ForwardIterator __first, _Size __count)
 

Detailed Description

Components for memory allocation, deallocation, and management.

Function Documentation

◆ align()

void* std::align ( size_t  __align,
size_t  __size,
void *&  __ptr,
size_t &  __space 
)
inlinenoexcept

Fit aligned storage in buffer.

This function tries to fit __size bytes of storage with alignment __align into the buffer __ptr of size __space bytes. If such a buffer fits then __ptr is changed to point to the first byte of the aligned storage and __space is reduced by the bytes used for alignment.

C++11 20.6.5 [ptr.align]

Parameters
__alignA fundamental or extended alignment value.
__sizeSize of the aligned storage required.
__ptrPointer to a buffer of __space bytes.
__spaceSize of the buffer pointed to by __ptr.
Returns
the updated pointer if the aligned storage fits, otherwise nullptr.

Definition at line 62 of file align.h.

◆ assume_aligned()

template<size_t _Align, class _Tp >
constexpr _Tp* std::assume_aligned ( _Tp *  __ptr)
constexprnoexcept

Inform the compiler that a pointer is aligned.

Template Parameters
_AlignAn alignment value (i.e. a power of two)
_TpAn object type
Parameters
__ptrA pointer that is aligned to _Align

C++20 20.10.6 [ptr.align]

Definition at line 93 of file align.h.

References std::has_single_bit(), and std::is_constant_evaluated().

◆ uninitialized_copy()

template<typename _InputIterator , typename _ForwardIterator >
_ForwardIterator std::uninitialized_copy ( _InputIterator  __first,
_InputIterator  __last,
_ForwardIterator  __result 
)
inline

Copies the range [first,last) into result.

Parameters
__firstAn input iterator.
__lastAn input iterator.
__resultAn output iterator.
Returns
__result + (__first - __last)

Like copy(), but does not require an initialized output range.

Definition at line 163 of file stl_uninitialized.h.

Referenced by __gnu_parallel::parallel_sort_mwms_pu(), and std::uninitialized_move().

◆ uninitialized_copy_n()

template<typename _InputIterator , typename _Size , typename _ForwardIterator >
_ForwardIterator std::uninitialized_copy_n ( _InputIterator  __first,
_Size  __n,
_ForwardIterator  __result 
)
inline

Copies the range [first,first+n) into result.

Parameters
__firstAn input iterator.
__nThe number of elements to copy.
__resultAn output iterator.
Returns
__result + __n
Since
C++11

Like copy_n(), but does not require an initialized output range.

Definition at line 935 of file stl_uninitialized.h.

◆ uninitialized_default_construct()

template<typename _ForwardIterator >
void std::uninitialized_default_construct ( _ForwardIterator  __first,
_ForwardIterator  __last 
)
inline

Default-initializes objects in the range [first,last).

Parameters
__firstA forward iterator.
__lastA forward iterator.
Since
C++17

Definition at line 964 of file stl_uninitialized.h.

◆ uninitialized_default_construct_n()

template<typename _ForwardIterator , typename _Size >
_ForwardIterator std::uninitialized_default_construct_n ( _ForwardIterator  __first,
_Size  __count 
)
inline

Default-initializes objects in the range [first,first+count).

Parameters
__firstA forward iterator.
__countThe number of objects to construct.
Returns
__first + __count
Since
C++17

Definition at line 979 of file stl_uninitialized.h.

◆ uninitialized_fill()

template<typename _ForwardIterator , typename _Tp >
void std::uninitialized_fill ( _ForwardIterator  __first,
_ForwardIterator  __last,
const _Tp &  __x 
)
inline

Copies the value x into the range [first,last).

Parameters
__firstAn input iterator.
__lastAn input iterator.
__xThe source value.
Returns
Nothing.

Like fill(), but does not require an initialized output range.

Definition at line 241 of file stl_uninitialized.h.

◆ uninitialized_fill_n()

template<typename _ForwardIterator , typename _Size , typename _Tp >
_ForwardIterator std::uninitialized_fill_n ( _ForwardIterator  __first,
_Size  __n,
const _Tp &  __x 
)
inline

Copies the value x into the range [first,first+n).

Parameters
__firstAn input iterator.
__nThe number of copies to make.
__xThe source value.
Returns
Nothing.

Like fill_n(), but does not require an initialized output range.

Definition at line 312 of file stl_uninitialized.h.

◆ uninitialized_move()

template<typename _InputIterator , typename _ForwardIterator >
_ForwardIterator std::uninitialized_move ( _InputIterator  __first,
_InputIterator  __last,
_ForwardIterator  __result 
)
inline

Move-construct from the range [first,last) into result.

Parameters
__firstAn input iterator.
__lastAn input iterator.
__resultAn output iterator.
Returns
__result + (__first - __last)
Since
C++17

Definition at line 1022 of file stl_uninitialized.h.

References std::uninitialized_copy().

◆ uninitialized_move_n()

template<typename _InputIterator , typename _Size , typename _ForwardIterator >
pair<_InputIterator, _ForwardIterator> std::uninitialized_move_n ( _InputIterator  __first,
_Size  __count,
_ForwardIterator  __result 
)
inline

Move-construct from the range [first,first+count) into result.

Parameters
__firstAn input iterator.
__countThe number of objects to initialize.
__resultAn output iterator.
Returns
__result + __count
Since
C++17

Definition at line 1040 of file stl_uninitialized.h.

◆ uninitialized_value_construct()

template<typename _ForwardIterator >
void std::uninitialized_value_construct ( _ForwardIterator  __first,
_ForwardIterator  __last 
)
inline

Value-initializes objects in the range [first,last).

Parameters
__firstA forward iterator.
__lastA forward iterator.
Since
C++17

Definition at line 992 of file stl_uninitialized.h.

◆ uninitialized_value_construct_n()

template<typename _ForwardIterator , typename _Size >
_ForwardIterator std::uninitialized_value_construct_n ( _ForwardIterator  __first,
_Size  __count 
)
inline

Value-initializes objects in the range [first,first+count).

Parameters
__firstA forward iterator.
__countThe number of objects to construct.
Returns
__result + __count
Since
C++17

Definition at line 1007 of file stl_uninitialized.h.