MySQL 9.1.0
Source Code Documentation
|
Miscellaneous global dependencies (declarations). More...
#include "my_config.h"
#include <atomic>
#include <stddef.h>
#include <sys/socket.h>
#include <sys/types.h>
#include "my_compiler.h"
#include "my_inttypes.h"
#include "sql/thr_malloc.h"
#include <mysql/components/services/mysql_server_telemetry_traces_service.h>
Go to the source code of this file.
Classes | |
struct | PFS_cacheline_atomic_uint32 |
An atomic uint32 variable, guaranteed to be alone in a CPU cache line. More... | |
struct | PFS_cacheline_atomic_uint64 |
An atomic uint64 variable, guaranteed to be alone in a CPU cache line. More... | |
struct | PFS_cacheline_atomic_size_t |
An atomic size_t variable, guaranteed to be alone in a CPU cache line. More... | |
struct | PFS_cacheline_atomic_ptr< T > |
An atomic<T> variable, guaranteed to be alone in a CPU cache line. More... | |
Macros | |
#define | PFS_ALIGNMENT 64 |
#define | PFS_ALIGNED alignas(PFS_ALIGNMENT) |
#define | PFS_CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE |
#define | PFS_MALLOC_ARRAY(k, n, s, T, f) reinterpret_cast<T *>(pfs_malloc_array((k), (n), (s), (f))) |
Helper, to allocate an array of structures. More... | |
#define | PFS_FREE_ARRAY(k, n, s, p) pfs_free_array((k), (n), (s), (p)) |
Helper, to free an array of structures. More... | |
#define | PFS_NEW(CLASS) (new (*THR_MALLOC) CLASS()) |
Helper to allocate an object from mem_root. More... | |
#define | SANITIZE_ARRAY_BODY(T, ARRAY, MAX, UNSAFE) |
Given an array defined as T ARRAY[MAX], check that an UNSAFE pointer actually points to an element within the array. More... | |
Functions | |
void * | pfs_malloc (PFS_builtin_memory_class *klass, size_t size, myf flags) |
Memory allocation for the performance schema. More... | |
void * | pfs_malloc_array (PFS_builtin_memory_class *klass, size_t n, size_t size, myf flags) |
Allocate an array of structures with overflow check. More... | |
void | pfs_free (PFS_builtin_memory_class *klass, size_t size, void *ptr) |
Free memory allocated with. More... | |
void | pfs_free_array (PFS_builtin_memory_class *klass, size_t n, size_t size, void *ptr) |
Free memory allocated with. More... | |
bool | is_overflow (size_t product, size_t n1, size_t n2) |
Detect multiplication overflow. More... | |
uint | pfs_get_socket_address (char *host, uint host_len, uint *port, const struct sockaddr_storage *src_addr, socklen_t src_len) |
Convert raw ip address into readable format. More... | |
void | pfs_print_error (const char *format,...) |
Variables | |
bool | pfs_initialized |
True when the performance schema is initialized. More... | |
Miscellaneous global dependencies (declarations).
#define PFS_ALIGNED alignas(PFS_ALIGNMENT) |
#define PFS_ALIGNMENT 64 |
#define PFS_CACHE_LINE_SIZE CPU_LEVEL1_DCACHE_LINESIZE |
#define PFS_FREE_ARRAY | ( | k, | |
n, | |||
s, | |||
p | |||
) | pfs_free_array((k), (n), (s), (p)) |
Helper, to free an array of structures.
k | memory class |
n | number of elements in the array |
s | size of array element |
p | the array to free |
#define PFS_MALLOC_ARRAY | ( | k, | |
n, | |||
s, | |||
T, | |||
f | |||
) | reinterpret_cast<T *>(pfs_malloc_array((k), (n), (s), (f))) |
Helper, to allocate an array of structures.
k | memory class |
n | number of elements in the array |
s | size of array element |
T | type of an element |
f | flags to use when allocating memory |
#define PFS_NEW | ( | CLASS | ) | (new (*THR_MALLOC) CLASS()) |
Helper to allocate an object from mem_root.
CLASS | Class to instantiate |
bool is_overflow | ( | size_t | product, |
size_t | n1, | ||
size_t | n2 | ||
) |
Detect multiplication overflow.
product | multiplication product |
n1 | operand |
n2 | operand |
void pfs_free | ( | PFS_builtin_memory_class * | klass, |
size_t | size, | ||
void * | ptr | ||
) |
Free memory allocated with.
void pfs_free_array | ( | PFS_builtin_memory_class * | klass, |
size_t | n, | ||
size_t | size, | ||
void * | ptr | ||
) |
Free memory allocated with.
Free memory allocated with.
klass | performance schema memory class |
n | number of array elements |
size | element size |
ptr | pointer to memory |
uint pfs_get_socket_address | ( | char * | host, |
uint | host_len, | ||
uint * | port, | ||
const struct sockaddr_storage * | src_addr, | ||
socklen_t | src_len | ||
) |
Convert raw ip address into readable format.
Do not do a reverse DNS lookup.
void * pfs_malloc | ( | PFS_builtin_memory_class * | klass, |
size_t | size, | ||
myf | flags | ||
) |
Memory allocation for the performance schema.
The memory used internally in the performance schema implementation. It is allocated at startup, or during runtime with scalable buffers.
void * pfs_malloc_array | ( | PFS_builtin_memory_class * | klass, |
size_t | n, | ||
size_t | size, | ||
myf | flags | ||
) |
Allocate an array of structures with overflow check.
Allocate an array of structures with overflow check.
Checks for overflow of n * size before allocating.
klass | performance schema memory class |
n | number of array elements |
size | element size |
flags | malloc flags |
void pfs_print_error | ( | const char * | format, |
... | |||
) |
|
extern |
True when the performance schema is initialized.