MySQL 9.0.0
Source Code Documentation
service_mysql_alloc.h File Reference
#include <stdlib.h>
#include "mysql/components/services/bits/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, bool claim)
 
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)
 Allocates size bytes of memory. More...
 
void * my_realloc (PSI_memory_key key, void *ptr, size_t size, myf_t flags)
 
void my_claim (const void *ptr, bool claim)
 
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, bool claim)

◆ 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,
bool  claim 
)

◆ 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 
)

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. Could be MY_ZEROFILL

◆ 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