Thread local "stateless" allocator.
More...
#include <playrho/pmr/ThreadLocalAllocator.hpp>
|
static constexpr auto | max_size () noexcept -> std::size_t |
| Max size usable by instances of this allocator. More...
|
|
static PLAYRHO_EXPORT auto | resource () -> MemoryResource * |
| Gets the underlying memory resource for this class.
|
|
template<class T, class MemoryResource, class... MemoryResourceArgs>
class playrho::ThreadLocalAllocator< T, MemoryResource, MemoryResourceArgs >
Thread local "stateless" allocator.
- Note
- This is meant to meet the allocator named requirements.
-
Being a "stateless" allocator, means that objects of this type do not have any non-static data members - i.e. instances themselves don't have any state.
- Warning
- Behavior is not specified if memory allocated by this class is ever used or deallocated by a different thread.
- Template Parameters
-
T | cv-unqualified object type of each array element that the instantiated allocator will allocate buffers for. |
MemoryResource | The pmr::memory_resource derived type that the instantiated allocator will use to allocate and deallocate buffers from and to. |
MemoryResourceArgs | Zero or more default constructable functor types for passing compile-time arguments for construction of the memory resource object. |
- See also
- https://en.cppreference.com/w/cpp/named_req/Allocator.
◆ resource_args
template<class T , class MemoryResource , class... MemoryResourceArgs>
Resource argument functors.
This is the list of zero or more types providing arguments for constructing the resource type.
◆ value_type
template<class T , class MemoryResource , class... MemoryResourceArgs>
Value type of this class.
- Note
- This is a required alias of the allocator named requirement.
◆ allocate()
template<class T , class MemoryResource , class... MemoryResourceArgs>
Allocate interface function.
- Note
- Calls underlying resource's allocate function if given size is not too large for this class.
- Exceptions
-
std::bad_array_new_length | if given a size greater than max_size() . |
◆ max_size()
template<class T , class MemoryResource , class... MemoryResourceArgs>
|
inlinestaticconstexprnoexcept |
◆ operator!=
template<class T , class MemoryResource , class... MemoryResourceArgs>
Inequality support.
- Returns
- false.
◆ operator==
template<class T , class MemoryResource , class... MemoryResourceArgs>
Equality support.
- Returns
- true.
The documentation for this class was generated from the following file:
- Library/include/playrho/pmr/ThreadLocalAllocator.hpp