MySQL 9.1.0
Source Code Documentation
memory::PFS_allocator< T > Class Template Reference

Allocator class for instrumenting allocated memory with Performance Schema keys. More...

#include <unique_ptr.h>

Private Types

using value_type = T
 
using size_type = size_t
 

Private Member Functions

 PFS_allocator (PSI_memory_key key)
 Constructor for the class that takes the PFS key to be used. More...
 
template<typename U >
 PFS_allocator (PFS_allocator< U > const &rhs) noexcept
 Copy constructor. More...
 
template<typename U >
 PFS_allocator (PFS_allocator< U > &&rhs) noexcept
 Move constructor. More...
 
PSI_memory_key key () const
 Retrieves the PFS for this allocator object. More...
 
T * allocate (std::size_t n)
 Allocate n bytes and return a pointer to the beginning of the allocated memory. More...
 
void deallocate (T *p, std::size_t n) noexcept
 Deallocates the n bytes stored in the memory pointer p is pointing to. More...
 
template<class U , class... Args>
void construct (U *p, Args &&...args)
 In-place constructs an object of class U in the memory pointed by p. More...
 
void destroy (T *p)
 In-place invokes the destructor for class T on object pointed by p. More...
 
size_type max_size () const
 The maximum size available to allocate. More...
 

Private Attributes

PSI_memory_key m_key
 The PFS key to be used to allocate memory. More...
 

Detailed Description

template<typename T>
class memory::PFS_allocator< T >

Allocator class for instrumenting allocated memory with Performance Schema keys.

Member Typedef Documentation

◆ size_type

template<typename T >
using memory::PFS_allocator< T >::size_type = size_t
private

◆ value_type

template<typename T >
using memory::PFS_allocator< T >::value_type = T
private

Constructor & Destructor Documentation

◆ PFS_allocator() [1/3]

template<typename T >
memory::PFS_allocator< T >::PFS_allocator ( PSI_memory_key  key)
private

Constructor for the class that takes the PFS key to be used.

Parameters
keyThe PFS key to be used.

◆ PFS_allocator() [2/3]

template<typename T >
template<typename U >
memory::PFS_allocator< T >::PFS_allocator ( PFS_allocator< U > const &  rhs)
privatenoexcept

Copy constructor.

Parameters
rhsThe object to copy from.

◆ PFS_allocator() [3/3]

template<typename T >
template<typename U >
memory::PFS_allocator< T >::PFS_allocator ( PFS_allocator< U > &&  rhs)
privatenoexcept

Move constructor.

Parameters
rhsThe object to move from.

Member Function Documentation

◆ allocate()

template<typename T >
T * memory::PFS_allocator< T >::allocate ( std::size_t  n)
private

Allocate n bytes and return a pointer to the beginning of the allocated memory.

Parameters
nThe size of the memory to allocate.
Returns
A pointer to the beginning of the allocated memory.

◆ construct()

template<typename T >
template<class U , class... Args>
void memory::PFS_allocator< T >::construct ( U p,
Args &&...  args 
)
private

In-place constructs an object of class U in the memory pointed by p.

Parameters
pThe pointer to the beginning of the memory to construct the object in.
argsThe parameters to be used with the U constructor.

◆ deallocate()

template<typename T >
void memory::PFS_allocator< T >::deallocate ( T *  p,
std::size_t  n 
)
privatenoexcept

Deallocates the n bytes stored in the memory pointer p is pointing to.

Parameters
pThe pointer to the beginning of the memory to deallocate.
nThe size of the memory to deallocate.

◆ destroy()

template<typename T >
void memory::PFS_allocator< T >::destroy ( T *  p)
private

In-place invokes the destructor for class T on object pointed by p.

Parameters
pThe object pointer to invoke the destructor on.

◆ key()

template<typename T >
PSI_memory_key memory::PFS_allocator< T >::key
private

Retrieves the PFS for this allocator object.

Returns
The PFS key.

◆ max_size()

template<typename T >
size_t memory::PFS_allocator< T >::max_size
private

The maximum size available to allocate.

Returns
The maximum size available to allocate.

Member Data Documentation

◆ m_key

template<typename T >
PSI_memory_key memory::PFS_allocator< T >::m_key
private

The PFS key to be used to allocate memory.


The documentation for this class was generated from the following file: