29#ifndef MYSQL_ALLOCATORS_ALLOCATOR_H
30#define MYSQL_ALLOCATORS_ALLOCATOR_H
122 if (
p ==
nullptr)
throw std::bad_alloc();
Allocator using a Memory_resource to do the allocation.
Definition: allocator.h:52
constexpr Allocator & operator=(Allocator &&other) noexcept
Definition: allocator.h:106
std::false_type propagate_on_container_copy_assignment
On copy-assignment for containers using this allocator, make the target container preserve its existi...
Definition: allocator.h:66
std::true_type propagate_on_container_move_assignment
On move-assignment for containers using this allocator, make the target container inherit the allocat...
Definition: allocator.h:61
constexpr void deallocate(T *p, size_type size)
Use the Memory_resource to deallocate the given pointer.
Definition: allocator.h:131
T value_type
Definition: allocator.h:54
std::function< void(T *)> get_deleter()
Return a Deleter function for objects allocated by this class.
Definition: allocator.h:148
const Memory_resource & get_memory_resource() const
Return a reference to the underlying Memory_resource object.
Definition: allocator.h:159
constexpr Allocator & operator=(const Allocator &other) noexcept=default
constexpr Allocator(Allocator &&other) noexcept
Definition: allocator.h:102
std::ptrdiff_t difference_type
Definition: allocator.h:56
std::size_t size_type
Definition: allocator.h:55
~Allocator() noexcept=default
Allocator(Memory_resource memory_resource=Memory_resource()) noexcept
Construct a new Allocator using the given Memory_resource.
Definition: allocator.h:73
constexpr Allocator(const Allocator &other) noexcept=default
Memory_resource m_memory_resource
The underlying Memory_resource object.
Definition: allocator.h:165
constexpr T * allocate(size_type n)
Use the Memory_resource to allocate the given number of elements of type T.
Definition: allocator.h:120
constexpr Allocator(const Allocator< U > &other) noexcept
Implicit conversion from other instance.
Definition: allocator.h:83
Polymorphism-free memory resource class with custom allocator and deallocator functions.
Definition: memory_resource.h:88
void * allocate(Size_t n) const
Allocate memory using the provided allocator.
Definition: memory_resource.h:113
void deallocate(Ptr_t p) const
Deallocate memory using the provided deallocator.
Definition: memory_resource.h:118
Deallocator_t get_deallocator() const
Return the deallocator.
Definition: memory_resource.h:121
const char * p
Definition: ctype-mb.cc:1227
#define T
Definition: jit_executor_value.cc:373
Class that wraps resources in a polymorphic manner.
Definition: allocator.h:39
bool operator!=(const Allocator< T > &a1, const Allocator< T > &a2)
Compare two Allocator objects for inequality.
Definition: allocator.h:177
bool operator==(const Allocator< T > &a1, const Allocator< T > &a2)
Compare two Allocator objects for equality.
Definition: allocator.h:170
noexcept
The return type for any call_and_catch(f, args...) call where f(args...) returns Type.
Definition: call_and_catch.h:76
size_t size(const char *const c)
Definition: base64.h:46
Define std::hash<Gtid>.
Definition: gtid.h:355
int n
Definition: xcom_base.cc:509