Dynamic memory management
From Cppreference
< cpp
C++ Standard Library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Utilities library | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Dynamic memory management | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Contents |
[edit] Low level memory management
[edit] Allocators
Allocators are class templates encapsulating memory allocation strategy. This allows generic containers to decouple memory management from the data itself.
Defined in header
<memory> | |||
|
the default allocator (class template) |
||
|
provides information about allocator types (class template) |
||
|
tag type used to select allocator-aware constructor overloads (class) |
||
|
an object of type std::allocator_arg_t used to select allocator-aware constructors (constant) |
||
|
identifies allocator-aware types (class template) |
||
Defined in header
<scoped_allocator> | |||
|
implements multi-level allocator for multi-level containers (class template) |
[edit] Uninitialized storage
Several utilities are provided to create and access raw storage
Defined in header
<memory> | |||
|
copies a range of objects to an uninitialized area of memory (function template) |
||
|
copies a number of objects to an uninitialized area of memory (function template) |
||
|
copies an object to an uninitialized area of memory (function template) |
||
|
copies an object to an uninitialized area of memory (function template) |
||
|
an iterator that allows standard algorithms to store results in uninitialized memory (class template) |
||
|
obtains uninitialized storage (function template) |
||
|
frees uninitialized storage (function template) |
[edit] Smart pointers
Smart pointers enable automatic, exception-safe, object lifetime management.
Defined in header
<memory> | |||
pointer categories | |||
|
smart pointer with unique object ownership semantics (class template) |
||
|
smart pointer with shared object ownership semantics (class template) |
||
|
weak reference to an object managed by std::shared_ptr (class template) |
||
|
smart pointer with strict object ownership semantics (class template) |
||
helper classes | |||
|
provides mixed-type owner-based ordering of shared and weak pointesr (class template) |
||
|
allows an object to create a shared_ptr referring to itself (class template) |
||
|
exception thrown when accessing a weak_ptr which refers to already destroyed object (class template) |
||
|
default deleter for unique_ptr (class template) |
[edit] Garbage collector support
Defined in header
<memory> | |||
|
declares that an object can not be recycled (function) |
||
|
declares that an object can be recycled (function template) |
||
|
declares that a memory area does not contain traceable pointers (function) |
||
|
cancels the effect of std::declare_no_pointers (function) |
||
|
lists pointer safety models (class) |
||
|
returns the current pointer safety model (function) |
[edit] Miscellaneous
Defined in header
<memory> | |||
|
provides information about pointer-like types (class template) |
||
|
obtains actual address of an object, even if the & operator is overloaded (function template) |
||
|
aligns a pointer in a buffer (function) |