#include "cetl/pf17/memory_resource.hpp"
template<typename
T>
struct cetl::pf17::pmr::deviant::memory_resource_traits< T >
Used to access extensions to std::pmr::memory_resource that are only found in CETL.
Proper defaults are provided when using std::pmr::memory_resource.
- Template Parameters
-
◆ is_reallocate_defined
◆ max_size()
|
|
inlinestaticconstexprnoexcept |
◆ reallocate()
If supported, this will delegate to the memory_resource's reallocate method otherwise it will return nullptr.
This follows a similar behaviour contract described by std::reallocate with the implementation defined behaviour for zero-length reallocations being to always return nullptr.
- Note
- The behaviour of this method when called with a different alignment then used in the original allocation is implementation defined.
- Parameters
-
| mr | The memory_resource to use for allocation. |
| ptr | The pointer to reallocate. If the reallocation is successful this pointer is invalid and must not be used even if it's address is the same as the returned pointer. This pointer remains valid for any failure. |
| old_size_bytes | The number of bytes returned by the original allocation. |
| new_size_bytes | The number of bytes to change ptr to hold. |
| alignment | The alignment of the allocated memory. CETL will treat an inability to properly align or to support re-alignment of memory as an allocation failure. |
- Returns
- The allocated memory or std::nullptr if exceptions are disabled and an allocation failure occurs.
- Exceptions
-
| std::bad_alloc | Throws if any allocation errors occur. Implementations shall not leak memory even if the allocation fails. |
The documentation for this struct was generated from the following file: