MySQL  8.0.18
Source Code Documentation
service_mysql_alloc.h File Reference
#include <stdlib.h>
#include "mysql/components/services/psi_memory_bits.h"

Go to the source code of this file.

Classes

struct  mysql_malloc_service_st
 This service allows plugins to allocate and free memory through the server's memory handling routines. More...
 

Typedefs

typedef int myf_t
 
typedef void *(* mysql_malloc_t) (PSI_memory_key key, size_t size, myf_t flags)
 
typedef void *(* mysql_realloc_t) (PSI_memory_key key, void *ptr, size_t size, myf_t flags)
 
typedef void(* mysql_claim_t) (const void *ptr)
 
typedef void(* mysql_free_t) (void *ptr)
 
typedef void *(* my_memdup_t) (PSI_memory_key key, const void *from, size_t length, myf_t flags)
 
typedef char *(* my_strdup_t) (PSI_memory_key key, const char *from, myf_t flags)
 
typedef char *(* my_strndup_t) (PSI_memory_key key, const char *from, size_t length, myf_t flags)
 

Functions

void * my_malloc (PSI_memory_key key, size_t size, myf_t flags)
 Below functions are used by the components. More...
 
void * my_realloc (PSI_memory_key key, void *ptr, size_t size, myf_t flags)
 
void my_claim (const void *ptr)
 
void my_free (void *ptr)
 
Frees the memory pointed by the ptr. More...
 
void * my_memdup (PSI_memory_key key, const void *from, size_t length, myf_t flags)
 
char * my_strdup (PSI_memory_key key, const char *from, myf_t flags)
 
char * my_strndup (PSI_memory_key key, const char *from, size_t length, myf_t flags)
 

Variables

struct mysql_malloc_service_stmysql_malloc_service
 

Typedef Documentation

◆ my_memdup_t

typedef void*(* my_memdup_t) (PSI_memory_key key, const void *from, size_t length, myf_t flags)

◆ my_strdup_t

typedef char*(* my_strdup_t) (PSI_memory_key key, const char *from, myf_t flags)

◆ my_strndup_t

typedef char*(* my_strndup_t) (PSI_memory_key key, const char *from, size_t length, myf_t flags)

◆ myf_t

typedef int myf_t

◆ mysql_claim_t

typedef void(* mysql_claim_t) (const void *ptr)

◆ mysql_free_t

typedef void(* mysql_free_t) (void *ptr)

◆ mysql_malloc_t

typedef void*(* mysql_malloc_t) (PSI_memory_key key, size_t size, myf_t flags)

◆ mysql_realloc_t

typedef void*(* mysql_realloc_t) (PSI_memory_key key, void *ptr, size_t size, myf_t flags)

Function Documentation

◆ my_claim()

void my_claim ( const void *  ptr)

◆ my_free()

void my_free ( void *  ptr)


Frees the memory pointed by the ptr.

Parameters
ptrmemory address to be freed

◆ my_malloc()

void* my_malloc ( PSI_memory_key  key,
size_t  size,
myf_t  flags 
)

Below functions are used by the components.

And these functions will be in a static library(liblibrary_mysys.a) and the library is statically linked whenever any component needs these function.
Allocates size bytes of memory.

Parameters
keyP_S key used for memory instrumentation
sizesize bytes to allocate the memory
flagsused at the time of allocation

◆ my_memdup()

void* my_memdup ( PSI_memory_key  key,
const void *  from,
size_t  length,
myf_t  flags 
)

◆ my_realloc()

void* my_realloc ( PSI_memory_key  key,
void *  ptr,
size_t  size,
myf_t  flags 
)

◆ my_strdup()

char* my_strdup ( PSI_memory_key  key,
const char *  from,
myf_t  flags 
)

◆ my_strndup()

char* my_strndup ( PSI_memory_key  key,
const char *  from,
size_t  length,
myf_t  flags 
)

Variable Documentation

◆ mysql_malloc_service

struct mysql_malloc_service_st* mysql_malloc_service