MySQL 9.1.0
Source Code Documentation
ut0new.h File Reference

Dynamic memory allocation routines and custom allocators specifically crafted to support memory instrumentation through performance schema memory engine (PFS). More...

#include <algorithm>
#include <cerrno>
#include <cstddef>
#include <cstdlib>
#include <cstring>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <set>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#include "my_basename.h"
#include "mysql/components/services/bits/psi_bits.h"
#include "mysql/psi/mysql_memory.h"
#include "mysql/psi/psi_memory.h"
#include "detail/ut0new.h"
#include "os0proc.h"
#include "os0thread.h"
#include "univ.i"
#include "ut0byte.h"
#include "ut0cpu_cache.h"
#include "ut0dbg.h"
#include "ut0ut.h"

Go to the source code of this file.

Classes

struct  ut::allocation_low_level_info
 Can be used to extract pointer and size of the allocation provided by the OS. More...
 
struct  ut::PSI_memory_key_t
 Light-weight and type-safe wrapper around the PSI_memory_key that eliminates the possibility of introducing silent bugs through the course of implicit conversions and makes them show up as compile-time errors. More...
 
struct  force_constexpr< Value >
 
struct  ut::Count
 Light-weight and type-safe wrapper which serves a purpose of being able to select proper ut::new_arr* overload. More...
 
struct  ut::fallback_to_normal_page_t
 
class  ut::aligned_pointer< T, Alignment >
 Lightweight convenience wrapper which manages dynamically allocated over-aligned type. More...
 
class  ut::aligned_array_pointer< T, Alignment >
 Lightweight convenience wrapper which manages a dynamically allocated array of over-aligned types. More...
 
struct  ut::detail::allocator_base< T >
 
struct  ut::detail::allocator_base_pfs< T >
 
class  ut::allocator< T, Allocator_base >
 Allocator that allows std::* containers to manage their memory through ut::malloc* and ut::free library functions. More...
 
struct  ut::allocator< T, Allocator_base >::rebind< U >
 
struct  ut::detail::Deleter< T >
 
struct  ut::detail::Array_deleter< T >
 
struct  ut::detail::Aligned_deleter< T >
 
struct  ut::detail::Aligned_array_deleter< T >
 

Namespaces

namespace  ut
 This file contains a set of libraries providing overloads for regular dynamic allocation routines which allow for opt-in memory instrumentation through performance schema memory engine (PFS).
 
namespace  ut::detail
 

Macros

#define UT_NEW_THIS_FILE_PSI_INDEX    (force_constexpr<ut_new_get_key_by_file(MY_BASENAME)>::value)
 
#define UT_NEW_THIS_FILE_PSI_KEY
 

Typedefs

template<typename T >
using ut::unique_ptr = std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Array_deleter< std::remove_extent_t< T > > >, void > >
 The following is a common type that is returned by all the ut::make_unique (non-aligned) specializations listed above. More...
 
template<typename T >
using ut::unique_ptr_aligned = std::conditional_t< !std::is_array< T >::value, std::unique_ptr< T, detail::Aligned_deleter< T > >, std::conditional_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, detail::Aligned_array_deleter< std::remove_extent_t< T > > >, void > >
 The following is a common type that is returned by all the ut::make_unique_aligned (non-aligned) specializations listed above. More...
 
using ut::ostringstream = std::basic_ostringstream< char, std::char_traits< char >, ut::allocator< char > >
 Specialization of basic_ostringstream which uses ut::allocator. More...
 
template<typename T >
using ut::vector = std::vector< T, ut::allocator< T > >
 Specialization of vector which uses allocator. More...
 
template<typename T >
using ut::list = std::list< T, ut::allocator< T > >
 Specialization of list which uses ut_allocator. More...
 
template<typename Key , typename Compare = std::less<Key>>
using ut::set = std::set< Key, Compare, ut::allocator< Key > >
 Specialization of set which uses ut_allocator. More...
 
template<typename Key >
using ut::unordered_set = std::unordered_set< Key, std::hash< Key >, std::equal_to< Key >, ut::allocator< Key > >
 
template<typename Key , typename Value , typename Compare = std::less<Key>>
using ut::map = std::map< Key, Value, Compare, ut::allocator< std::pair< const Key, Value > > >
 Specialization of map which uses ut_allocator. More...
 
template<typename Key , typename Value , typename Hash = std::hash<Key>, typename Key_equal = std::equal_to<Key>>
using ut::unordered_map = std::unordered_map< Key, Value, Hash, Key_equal, ut::allocator< std::pair< const Key, Value > > >
 

Functions

PSI_memory_key_t ut::make_psi_memory_key (PSI_memory_key key)
 Convenience helper function to create type-safe representation of PSI_memory_key. More...
 
void ut_new_boot ()
 Setup the internal objects needed for ut::*_withkey() to operate. More...
 
void ut_new_boot_safe ()
 Setup the internal objects needed for ut::*_withkey() to operate. More...
 
constexpr bool ut_string_begins_with (const char *a, const char *b, size_t b_len)
 gcc 5 fails to evaluate costexprs at compile time. More...
 
constexpr size_t ut_len_without_extension (const char *file)
 Find the length of the filename without its file extension. More...
 
constexpr int ut_new_get_key_by_base_file (const char *file, size_t len)
 Retrieve a memory key (registered with PFS), given the file name of the caller. More...
 
constexpr int ut_new_get_key_by_file (const char *file)
 Retrieve a memory key (registered with PFS), given the file name of the caller. More...
 
void * ut::malloc_withkey (PSI_memory_key_t key, std::size_t size) noexcept
 Dynamically allocates storage of given size. More...
 
void * ut::malloc (std::size_t size) noexcept
 Dynamically allocates storage of given size. More...
 
void * ut::zalloc_withkey (PSI_memory_key_t key, std::size_t size) noexcept
 Dynamically allocates zero-initialized storage of given size. More...
 
void * ut::zalloc (std::size_t size) noexcept
 Dynamically allocates zero-initialized storage of given size. More...
 
void * ut::realloc_withkey (PSI_memory_key_t key, void *ptr, std::size_t size) noexcept
 Upsizes or downsizes already dynamically allocated storage to the new size. More...
 
void * ut::realloc (void *ptr, std::size_t size) noexcept
 Upsizes or downsizes already dynamically allocated storage to the new size. More...
 
void ut::free (void *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the ut::malloc*(), ut::realloc* or ut::zalloc*() variants. More...
 
template<typename T , typename... Args>
T * ut::new_withkey (PSI_memory_key_t key, Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename... Args>
T * ut::new_ (Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T >
void ut::delete_ (T *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the ut::new*() variants. More...
 
template<typename T , typename... Args>
T * ut::new_arr_withkey (PSI_memory_key_t key, Args &&...args)
 Dynamically allocates storage for an array of T's. More...
 
template<typename T , typename... Args>
T * ut::new_arr (Args &&...args)
 Dynamically allocates storage for an array of T's. More...
 
template<typename T >
T * ut::new_arr_withkey (PSI_memory_key_t key, Count count)
 Dynamically allocates storage for an array of T's. More...
 
template<typename T >
T * ut::new_arr (Count count)
 Dynamically allocates storage for an array of T's. More...
 
template<typename T >
void ut::delete_arr (T *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the ut::new_arr*() variants. More...
 
size_t ut::pfs_overhead () noexcept
 Returns number of bytes that ut::malloc_*, ut::zalloc_*, ut::realloc_* and ut::new_* variants will be using to store the necessary metadata for PFS. More...
 
void * ut::malloc_page_withkey (PSI_memory_key_t key, std::size_t size) noexcept
 Dynamically allocates system page-aligned storage of given size. More...
 
void * ut::malloc_page (std::size_t size) noexcept
 Dynamically allocates system page-aligned storage of given size. More...
 
size_t ut::page_allocation_size (void *ptr) noexcept
 Retrieves the total amount of bytes that are available for application code to use. More...
 
allocation_low_level_info ut::page_low_level_info (void *ptr) noexcept
 Retrieves the pointer and size of the allocation provided by the OS. More...
 
bool ut::free_page (void *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the ut::malloc_page*() variants. More...
 
void * ut::malloc_large_page_withkey (PSI_memory_key_t key, std::size_t size) noexcept
 Dynamically allocates memory backed up by large (huge) pages. More...
 
void * ut::malloc_large_page (std::size_t size) noexcept
 Dynamically allocates memory backed up by large (huge) pages. More...
 
size_t ut::large_page_allocation_size (void *ptr) noexcept
 Retrieves the total amount of bytes that are available for application code to use. More...
 
allocation_low_level_info ut::large_page_low_level_info (void *ptr) noexcept
 Retrieves the pointer and size of the allocation provided by the OS. More...
 
bool ut::free_large_page (void *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the ut::malloc_large_page*() variants. More...
 
void * ut::malloc_large_page_withkey (PSI_memory_key_t key, std::size_t size, fallback_to_normal_page_t, bool large_pages_enabled=os_use_large_pages) noexcept
 Dynamically allocates memory backed up by large (huge) pages. More...
 
void * ut::malloc_large_page (std::size_t size, fallback_to_normal_page_t, bool large_pages_enabled=os_use_large_pages) noexcept
 Dynamically allocates memory backed up by large (huge) pages. More...
 
size_t ut::large_page_allocation_size (void *ptr, fallback_to_normal_page_t) noexcept
 Retrieves the total amount of bytes that are available for application code to use. More...
 
allocation_low_level_info ut::large_page_low_level_info (void *ptr, fallback_to_normal_page_t) noexcept
 Retrieves the pointer and size of the allocation provided by the OS. More...
 
bool ut::free_large_page (void *ptr, fallback_to_normal_page_t) noexcept
 Releases storage which has been dynamically allocated through any of the ut::malloc_large_page*(fallback_to_normal_page_t) variants. More...
 
void * ut::aligned_alloc_withkey (PSI_memory_key_t key, std::size_t size, std::size_t alignment) noexcept
 Dynamically allocates storage of given size and at the address aligned to the requested alignment. More...
 
void * ut::aligned_alloc (std::size_t size, std::size_t alignment) noexcept
 Dynamically allocates storage of given size and at the address aligned to the requested alignment. More...
 
void * ut::aligned_zalloc_withkey (PSI_memory_key_t key, std::size_t size, std::size_t alignment) noexcept
 Dynamically allocates zero-initialized storage of given size and at the address aligned to the requested alignment. More...
 
void * ut::aligned_zalloc (std::size_t size, std::size_t alignment) noexcept
 Dynamically allocates zero-initialized storage of given size and at the address aligned to the requested alignment. More...
 
void ut::aligned_free (void *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the aligned_alloc_*() or aligned_zalloc_*() variants. More...
 
template<typename T , typename... Args>
T * ut::aligned_new_withkey (PSI_memory_key_t key, std::size_t alignment, Args &&...args)
 Dynamically allocates storage for an object of type T at address aligned to the requested alignment. More...
 
template<typename T , typename... Args>
T * ut::aligned_new (std::size_t alignment, Args &&...args)
 Dynamically allocates storage for an object of type T at address aligned to the requested alignment. More...
 
template<typename T >
void ut::aligned_delete (T *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the aligned_new_*() variants. More...
 
template<typename T , typename... Args>
T * ut::aligned_new_arr_withkey (PSI_memory_key_t key, std::size_t alignment, Args &&...args)
 Dynamically allocates storage for an array of T's at address aligned to the requested alignment. More...
 
template<typename T >
T * ut::aligned_new_arr_withkey (PSI_memory_key_t key, std::size_t alignment, Count count)
 Dynamically allocates storage for an array of T's at address aligned to the requested alignment. More...
 
template<typename T , typename... Args>
T * ut::aligned_new_arr (std::size_t alignment, Args &&...args)
 Dynamically allocates storage for an array of T's at address aligned to the requested alignment. More...
 
template<typename T >
T * ut::aligned_new_arr (std::size_t alignment, Count count)
 Dynamically allocates storage for an array of T's at address aligned to the requested alignment. More...
 
template<typename T >
void ut::aligned_delete_arr (T *ptr) noexcept
 Releases storage which has been dynamically allocated through any of the aligned_new_arr_*() variants. More...
 
template<typename T , typename Deleter = detail::Deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::unique_ptr< T, Deleter > > ut::make_unique (Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename Deleter = detail::Deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::unique_ptr< T, Deleter > > ut::make_unique (PSI_memory_key_t key, Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, Deleter > > ut::make_unique (size_t size)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, Deleter > > ut::make_unique (PSI_memory_key_t key, size_t size)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename... Args>
std::enable_if_t< detail::is_bounded_array_v< T > > ut::make_unique (Args &&...)=delete
 std::unique_ptr for arrays of known compile-time bound are disallowed. More...
 
template<typename T , typename... Args>
std::enable_if_t< detail::is_bounded_array_v< T > > ut::make_unique (PSI_memory_key_t key, Args &&...)=delete
 std::unique_ptr in PFS-enabled builds for arrays of known compile-time bound are disallowed. More...
 
template<typename T , typename Deleter = detail::Aligned_deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::unique_ptr< T, Deleter > > ut::make_unique_aligned (size_t alignment, Args &&...args)
 Dynamically allocates storage for an object of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::unique_ptr< T, Deleter > > ut::make_unique_aligned (PSI_memory_key_t key, size_t alignment, Args &&...args)
 Dynamically allocates storage for an array of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, Deleter > > ut::make_unique_aligned (size_t alignment, size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::unique_ptr< T, Deleter > > ut::make_unique_aligned (PSI_memory_key_t key, size_t alignment, size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename... Args>
std::enable_if_t< detail::is_bounded_array_v< T > > ut::make_unique_aligned (Args &&...)=delete
 std::unique_ptr for arrays of known compile-time bound are disallowed. More...
 
template<typename T , typename... Args>
std::enable_if_t< detail::is_bounded_array_v< T > > ut::make_unique_aligned (PSI_memory_key_t key, Args &&...)=delete
 std::unique_ptr in PFS-enabled builds for arrays of known compile-time bound are disallowed. More...
 
template<typename T , typename Deleter = detail::Deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::shared_ptr< T > > ut::make_shared (Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename Deleter = detail::Deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::shared_ptr< T > > ut::make_shared (PSI_memory_key_t key, Args &&...args)
 Dynamically allocates storage for an object of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::shared_ptr< T > > ut::make_shared (size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::shared_ptr< T > > ut::make_shared (PSI_memory_key_t key, size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_bounded_array_v< T >, std::shared_ptr< T > > ut::make_shared ()
 Dynamically allocates storage for an array of objects of type T. More...
 
template<typename T , typename Deleter = detail::Array_deleter<std::remove_extent_t<T>>>
std::enable_if_t< detail::is_bounded_array_v< T >, std::shared_ptr< T > > ut::make_shared (PSI_memory_key_t key)
 Dynamically allocates storage for an array of objects of type T. More...
 
template<typename T , typename Deleter = detail::Aligned_deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::shared_ptr< T > > ut::make_shared_aligned (size_t alignment, Args &&...args)
 Dynamically allocates storage for an object of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_deleter<T>, typename... Args>
std::enable_if_t<!std::is_array< T >::value, std::shared_ptr< T > > ut::make_shared_aligned (PSI_memory_key_t key, size_t alignment, Args &&...args)
 Dynamically allocates storage for an object of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::shared_ptr< T > > ut::make_shared_aligned (size_t alignment, size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_unbounded_array_v< T >, std::shared_ptr< T > > ut::make_shared_aligned (PSI_memory_key_t key, size_t alignment, size_t size)
 Dynamically allocates storage for an array of requested size of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_bounded_array_v< T >, std::shared_ptr< T > > ut::make_shared_aligned (size_t alignment)
 Dynamically allocates storage for an array of objects of type T at address aligned to the requested alignment. More...
 
template<typename T , typename Deleter = detail::Aligned_array_deleter< std::remove_extent_t<T>>>
std::enable_if_t< detail::is_bounded_array_v< T >, std::shared_ptr< T > > ut::make_shared_aligned (PSI_memory_key_t key, size_t alignment)
 Dynamically allocates storage for an array of objects of type T at address aligned to the requested alignment. More...
 

Variables

const size_t alloc_max_retries
 Maximum number of retries to allocate memory. More...
 
PSI_memory_key mem_key_ahi
 Keys for registering allocations with performance schema. More...
 
PSI_memory_key mem_key_archive
 
PSI_memory_key mem_key_buf_buf_pool
 
PSI_memory_key mem_key_buf_stat_per_index_t
 
PSI_memory_key mem_key_clone
 Memory key for clone. More...
 
PSI_memory_key mem_key_dict_stats_bg_recalc_pool_t
 
PSI_memory_key mem_key_dict_stats_index_map_t
 
PSI_memory_key mem_key_dict_stats_n_diff_on_level
 
PSI_memory_key mem_key_fil_space_t
 
PSI_memory_key mem_key_lock_sys
 
PSI_memory_key mem_key_redo_log_archive_queue_element
 
PSI_memory_key mem_key_other
 
PSI_memory_key mem_key_partitioning
 
PSI_memory_key mem_key_row_log_buf
 
PSI_memory_key mem_key_ddl
 
PSI_memory_key mem_key_std
 
PSI_memory_key mem_key_trx_sys_t_rw_trx_ids
 
PSI_memory_key mem_key_undo_spaces
 
PSI_memory_key mem_key_ut_lock_free_hash_t
 
static constexpr const char * auto_event_names []
 List of filenames that allocate memory and are instrumented via PFS. More...
 
static constexpr size_t n_auto = UT_ARR_SIZE(auto_event_names)
 
PSI_memory_key auto_event_keys [n_auto]
 
PSI_memory_info pfs_info_auto [n_auto]
 
constexpr bool ut::WITH_PFS_MEMORY = true
 
template<typename >
constexpr bool ut::detail::is_unbounded_array_v = false
 
template<typename T >
constexpr bool ut::detail::is_unbounded_array_v< T[]> = true
 
template<typename >
constexpr bool ut::detail::is_bounded_array_v = false
 
template<typename T , std::size_t N>
constexpr bool ut::detail::is_bounded_array_v< T[N]> = true
 
template<typename >
constexpr size_t ut::detail::bounded_array_size_v = 0
 
template<typename T , std::size_t N>
constexpr size_t ut::detail::bounded_array_size_v< T[N]> = N
 

Detailed Description

Dynamic memory allocation routines and custom allocators specifically crafted to support memory instrumentation through performance schema memory engine (PFS).

Macro Definition Documentation

◆ UT_NEW_THIS_FILE_PSI_INDEX

#define UT_NEW_THIS_FILE_PSI_INDEX    (force_constexpr<ut_new_get_key_by_file(MY_BASENAME)>::value)

◆ UT_NEW_THIS_FILE_PSI_KEY

#define UT_NEW_THIS_FILE_PSI_KEY
Value:
PSI_memory_key_t make_psi_memory_key(PSI_memory_key key)
Convenience helper function to create type-safe representation of PSI_memory_key.
Definition: ut0new.h:190
PSI_memory_key auto_event_keys[n_auto]
#define UT_NEW_THIS_FILE_PSI_INDEX
Definition: ut0new.h:563
#define PSI_NOT_INSTRUMENTED
Definition: validate_password_imp.cc:44

Function Documentation

◆ ut_len_without_extension()

constexpr size_t ut_len_without_extension ( const char *  file)
constexpr

Find the length of the filename without its file extension.

Parameters
[in]filefilename, with extension but without directory
Returns
length, in bytes

◆ ut_new_boot()

void ut_new_boot ( )

Setup the internal objects needed for ut::*_withkey() to operate.

This must be called before the first call to ut::*_withkey().

Setup the internal objects needed for ut::*_withkey() to operate.

This must be called before the first call to ut::new_withkey().

◆ ut_new_boot_safe()

void ut_new_boot_safe ( )

Setup the internal objects needed for ut::*_withkey() to operate.

This must be called before the first call to ut::*_withkey(). This version of function might be called several times and it will simply skip all calls except the first one, during which the initialization will happen.

◆ ut_new_get_key_by_base_file()

constexpr int ut_new_get_key_by_base_file ( const char *  file,
size_t  len 
)
constexpr

Retrieve a memory key (registered with PFS), given the file name of the caller.

Parameters
[in]fileportion of the filename - basename, with extension
[in]lenlength of the filename to check for
Returns
index to registered memory key or -1 if not found

◆ ut_new_get_key_by_file()

constexpr int ut_new_get_key_by_file ( const char *  file)
constexpr

Retrieve a memory key (registered with PFS), given the file name of the caller.

Parameters
[in]fileportion of the filename - basename, with extension
Returns
index to memory key or -1 if not found

◆ ut_string_begins_with()

constexpr bool ut_string_begins_with ( const char *  a,
const char *  b,
size_t  b_len 
)
constexpr

gcc 5 fails to evaluate costexprs at compile time.

Compute whether a string begins with a given prefix, compile-time.

Parameters
[in]afirst string, taken to be zero-terminated
[in]bsecond string (prefix to search for)
[in]b_lenlength in bytes of second string
Returns
whether b is a prefix of a

Variable Documentation

◆ alloc_max_retries

const size_t alloc_max_retries
extern

Maximum number of retries to allocate memory.

◆ auto_event_keys

PSI_memory_key auto_event_keys[n_auto]
extern

◆ auto_event_names

constexpr const char* auto_event_names[]
staticconstexpr

List of filenames that allocate memory and are instrumented via PFS.

◆ mem_key_ahi

PSI_memory_key mem_key_ahi
extern

Keys for registering allocations with performance schema.

Pointers to these variables are supplied to PFS code via the pfs_info[] array and the PFS code initializes them via PSI_MEMORY_CALL(register_memory)(). mem_key_other and mem_key_std are special in the following way. If the caller has not provided a key and the file name of the caller is unknown, then mem_key_std will be used. This happens only when called from within std::* containers. If the caller has not provided a key and the file name of the caller is known, but is not amongst the predefined names (see ut_new_boot()) then mem_key_other will be used. Generally this should not happen and if it happens then that means that the list of predefined names must be extended. Keep this list alphabetically sorted.

Keep this list alphabetically sorted.

◆ mem_key_archive

PSI_memory_key mem_key_archive
extern

◆ mem_key_buf_buf_pool

PSI_memory_key mem_key_buf_buf_pool
extern

◆ mem_key_buf_stat_per_index_t

PSI_memory_key mem_key_buf_stat_per_index_t
extern

◆ mem_key_clone

PSI_memory_key mem_key_clone
extern

Memory key for clone.

◆ mem_key_ddl

PSI_memory_key mem_key_ddl
extern

◆ mem_key_dict_stats_bg_recalc_pool_t

PSI_memory_key mem_key_dict_stats_bg_recalc_pool_t
extern

◆ mem_key_dict_stats_index_map_t

PSI_memory_key mem_key_dict_stats_index_map_t
extern

◆ mem_key_dict_stats_n_diff_on_level

PSI_memory_key mem_key_dict_stats_n_diff_on_level
extern

◆ mem_key_fil_space_t

PSI_memory_key mem_key_fil_space_t
extern

◆ mem_key_lock_sys

PSI_memory_key mem_key_lock_sys
extern

◆ mem_key_other

PSI_memory_key mem_key_other
extern

◆ mem_key_partitioning

PSI_memory_key mem_key_partitioning
extern

◆ mem_key_redo_log_archive_queue_element

PSI_memory_key mem_key_redo_log_archive_queue_element
extern

◆ mem_key_row_log_buf

PSI_memory_key mem_key_row_log_buf
extern

◆ mem_key_std

PSI_memory_key mem_key_std
extern

◆ mem_key_trx_sys_t_rw_trx_ids

PSI_memory_key mem_key_trx_sys_t_rw_trx_ids
extern

◆ mem_key_undo_spaces

PSI_memory_key mem_key_undo_spaces
extern

◆ mem_key_ut_lock_free_hash_t

PSI_memory_key mem_key_ut_lock_free_hash_t
extern

◆ n_auto

constexpr size_t n_auto = UT_ARR_SIZE(auto_event_names)
staticconstexpr

◆ pfs_info_auto

PSI_memory_info pfs_info_auto[n_auto]
extern