Wraps a memory_resource and makes it a RawAllocator.
More...
#include <wpi/memory/memory_resource_adapter.hpp>
Wraps a memory_resource and makes it a RawAllocator.
◆ memory_resource_allocator()
wpi::memory::memory_resource_allocator::memory_resource_allocator |
( |
memory_resource * | ptr | ) |
|
|
inlinenoexcept |
- Effects:
- Creates it by giving it a pointer to the memory_resource.
- Requires:
ptr
must not be nullptr
.
◆ allocate_node()
void * wpi::memory::memory_resource_allocator::allocate_node |
( |
std::size_t | size, |
|
|
std::size_t | alignment ) |
|
inline |
- Effects:
- Allocates a node by forwarding to the
allocate()
function.
- Returns:
- The node as returned by the memory_resource.
- Throws:
- Anything thrown by the
allocate()
function.
◆ deallocate_node()
void wpi::memory::memory_resource_allocator::deallocate_node |
( |
void * | ptr, |
|
|
std::size_t | size, |
|
|
std::size_t | alignment ) |
|
inlinenoexcept |
- Effects:
- Deallocates a node by forwarding to the
deallocate()
function.
◆ max_alignment()
std::size_t wpi::memory::memory_resource_allocator::max_alignment |
( |
| ) |
const |
|
inlinenoexcept |
- Returns:
- The maximum alignment which is the maximum value of type
std::size_t
.
◆ resource()
memory_resource * wpi::memory::memory_resource_allocator::resource |
( |
| ) |
const |
|
inlinenoexcept |
The documentation for this class was generated from the following file: