![]() |
The Gaudi Framework
master (f31105fd)
|
Custom allocator holding a pointer to a generic memory resource. More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Allocator/Arena.h>
Classes | |
struct | rebind |
Public Types | |
using | value_type = T |
using | propagate_on_container_swap = std::true_type |
using | propagate_on_container_copy_assignment = std::true_type |
using | propagate_on_container_move_assignment = std::true_type |
Public Member Functions | |
constexpr | Arena (Resource *resource) noexcept |
Construct an allocator using the given memory resource, which must be valid. More... | |
template<typename D = void> | |
requires (std::is_invocable_r_v< Resource *, DefaultResource >) Arena() | |
Construct an allocator using the resource provided by DefaultResource. More... | |
template<typename U > | |
constexpr | Arena (Arena< Resource, U, DefaultResource > const &other) noexcept |
Converting copy constructor, rebinding U -> T. More... | |
T * | allocate (std::size_t n) |
Allocate storage for n objects. More... | |
void | deallocate (T *p, std::size_t n) noexcept |
Deallocate storage for n objects. More... | |
Resource * | resource () const noexcept |
Return a pointer to the memory resource. More... | |
Private Attributes | |
Resource * | m_resource { nullptr } |
Friends | |
template<typename , typename , typename > | |
struct | Arena |
template<typename U > | |
constexpr friend bool | operator== (Arena const &lhs, Arena< Resource, U, DefaultResource > const &rhs) |
Custom allocator holding a pointer to a generic memory resource.
Custom allocator holding a pointer to a memory resource ("arena"). Allocation and deallocation requests are passed through to the arena. Note that the typedefs propagate_on_container_{swap,copy_assignment,move_assignment} do not have their default values.
The, optional, third template parameter (DefaultResource) may be used to specify a default arena, in which case the allocator is default-constructible. Otherwise, a pointer to an arena must be given.
using Gaudi::Allocator::Arena< Resource, T, DefaultResource >::propagate_on_container_copy_assignment = std::true_type |
using Gaudi::Allocator::Arena< Resource, T, DefaultResource >::propagate_on_container_move_assignment = std::true_type |
using Gaudi::Allocator::Arena< Resource, T, DefaultResource >::propagate_on_container_swap = std::true_type |
using Gaudi::Allocator::Arena< Resource, T, DefaultResource >::value_type = T |
|
inlineconstexprnoexcept |
|
inlineconstexprnoexcept |
|
inline |
|
inlinenoexcept |
Deallocate storage for n objects.
|
inline |
|
inlinenoexcept |
|
friend |
|
private |